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

Re: Stack overflow with extended globs



On Mar 16,  5:28pm, Christian Neukirchen wrote:
}
} juno% setopt extendedglob; echo *(#c3,)x*
} 
} Program received signal SIGSEGV, Segmentation fault.

I think we want either this:

Index: Src/pattern.c
===================================================================
--- pattern.c	21 Dec 2010 16:41:16 -0000
+++ pattern.c	16 Mar 2013 18:21:36 -0000
@@ -1474,7 +1474,7 @@
     }
 
     /* too much at once doesn't currently work */
-    if (kshchar && pound)
+    if (kshchar && (pound || count))
 	return 0;
 
     if (kshchar == '*') {



Or this:

Index: Src/pattern.c
===================================================================
--- pattern.c	21 Dec 2010 16:41:16 -0000
+++ pattern.c	16 Mar 2013 18:23:53 -0000
@@ -1474,7 +1474,7 @@
     }
 
     /* too much at once doesn't currently work */
-    if (kshchar && pound)
+    if (kshchar && pound || kshchar < 0 && count)
 	return 0;
 
     if (kshchar == '*') {


But I'm not sure which.  I tend to think the former.



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