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

Re: Completion lockup



"Mikael Magnusson" wrote:
> zsh -f
> setopt rcquotes
> a'''<tab>
> Tried on two machines with 4.3.4-dev-7, both started spinning 100% cpu
> longer than i felt like waiting.

get_comp_string() is the second most horrible function ever written.
The following not only stopped the crash it apparently worked, i.e.
it complete a file a\'foobar I created in the path!  I didn't like
to look any further.  I'm sure you'll let me know if anything funny
is going on.

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.89
diff -u -r1.89 zle_tricky.c
--- Src/Zle/zle_tricky.c	3 Oct 2007 16:18:38 -0000	1.89
+++ Src/Zle/zle_tricky.c	9 Feb 2008 17:18:16 -0000
@@ -1230,11 +1230,16 @@
 	    /* This is done when the lexer reached the word the cursor is on. */
 	    tt = tokstr ? dupstring(tokstr) : NULL;
 
-            if (isset(RCQUOTES) && *tt == Snull) {
-                char *p, *e = tt + zlemetacs - wb;
-                for (p = tt; *p && p < e; p++)
-                    if (*p == '\'')
-                        qsub++;
+            if (isset(RCQUOTES)) {
+		char *tt1, *e = tt + zlemetacs - wb;
+		for (tt1 = tt; *tt1; tt1++) {
+		    if (*tt1 == Snull) {
+			char *p;
+			for (p = tt1; *p && p < e; p++)
+			    if (*p == '\'')
+				qsub++;
+		    }
+		}
             }
 	    /* If we added a `x', remove it. */
 	    if (addedx && tt)


-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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