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

PATCH: glob-array indexing fix



I just added some more array-indexing tests to the new 14array.ztst
file (which is run by "make check").  In so doing I noticed that the
glob-array indexing was not working right in my latest patch.  The fix
is trivial:

Index: Src/glob.c
@@ -1435,7 +1435,7 @@
 	end += matchct + 1;
     else if (end > matchct)
 	end = matchct;
-    if (end -= first > 0) {
+    if ((end -= first) > 0) {
 	matchptr = matchbuf + matchct - first - end;
 	while (end-- > 0) {		/* insert matches in the arg list */
 	    insertlinknode(list, node, matchptr->name);

It's nice to know that the test suite will now catch this if it ever
breaks again.  After this change, the new array code looks solid to
me.

..wayne..



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