aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2014-08-20 23:40:21 +0200
committerMikael Magnusson <mikachu@gmail.com>2014-08-21 01:23:32 +0200
commit33ad7174f6531c1e9052c71609c9084dfb35a2d8 (patch)
tree2e38656a328bcba8f1b4a67baf0bd56ba3cf0a10
parente5b504b97586d6a5c336a51ed4d0add4cc95ce51 (diff)
downloadzsh-33ad7174f6531c1e9052c71609c9084dfb35a2d8.tar.gz
zsh-33ad7174f6531c1e9052c71609c9084dfb35a2d8.tar.xz
zsh-33ad7174f6531c1e9052c71609c9084dfb35a2d8.zip
33038: Fix {^@..a} hanging
-rw-r--r--ChangeLog5
-rw-r--r--Src/glob.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b66b7e2be..ae8e4c6b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-21 Mikael Magnusson <mikachu@gmail.com>
+
+ * 33038: Src/glob.c: Fix {a..b} expansion hanging when either
+ endpoint is a literal NUL character
+
2014-08-20 Barton E. Schaefer <schaefer@zsh.org>
* Lokesh Mandvekar: 33032: Completion/Linux/Command/_docker,
diff --git a/Src/glob.c b/Src/glob.c
index 627166c7a..cb853870a 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2219,7 +2219,7 @@ xpandbraces(LinkList list, LinkNode *np)
uremnode(list, node);
strp = str - str3;
lenalloc = strp + strlen(str2+1) + 1;
- for (; cend >= cstart; cend--) {
+ do {
#ifdef MULTIBYTE_SUPPORT
char *ncptr;
int nclen;
@@ -2239,7 +2239,7 @@ xpandbraces(LinkList list, LinkNode *np)
insertlinknode(list, last, p);
if (rev) /* decreasing: add in reverse order. */
last = nextnode(last);
- }
+ } while (cend-- > cstart);
*np = nextnode(olast);
return;
}