Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Fix {^@..a} hanging



This should work for all possible cases, and is fine since we always
want to enter the loop at least once anyway.

---
 Src/glob.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Src/glob.c b/Src/glob.c
index 3bf66e4..bf758d4 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -2228,7 +2228,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;
@@ -2248,7 +2248,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;
 	}
-- 
1.9.0



Messages sorted by: Reverse Date, Date, Thread, Author