From 33ad7174f6531c1e9052c71609c9084dfb35a2d8 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 20 Aug 2014 23:40:21 +0200 Subject: [PATCH] 33038: Fix {^@..a} hanging --- ChangeLog | 5 +++++ Src/glob.c | 4 ++-- 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 + + * 33038: Src/glob.c: Fix {a..b} expansion hanging when either + endpoint is a literal NUL character + 2014-08-20 Barton E. Schaefer * 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; }