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

PATCH: Re: side effect of promptsubst.



Tanaka Akira wrote:

> ...
> |   foo="'and now' \"even the pubs\" \\a\\r\\e shut."
> |   print -r ${(Q)foo}
> | Error output:
> | Oops. Bug in parse_subst_string: len < l

Hmhm. The other uses of `len' look good.

Bye
 Sven

Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.4
diff -u -r1.4 lex.c
--- Src/lex.c	2000/05/04 08:43:31	1.4
+++ Src/lex.c	2000/05/04 09:56:55
@@ -1447,7 +1447,7 @@
 int
 parse_subst_string(char *s)
 {
-    int c, l = strlen(s), err;
+    int c, l = strlen(s), err, olen;
 
     if (! *s)
 	return 0;
@@ -1464,6 +1464,7 @@
     strinend();
     inpop();
     DPUTS(cmdsp, "BUG: parse_subst_string: cmdstack not empty.");
+    olen = len;
     lexrestore();
     errflag = err;
     if (c == LEXERR) {
@@ -1471,9 +1472,9 @@
 	return 1;
     }
 #ifdef DEBUG
-    if (c != STRING || len != l || errflag) {
+    if (c != STRING || olen != l || errflag) {
 	fprintf(stderr, "Oops. Bug in parse_subst_string: %s\n",
-		len < l ? "len < l" : errflag ? "errflag" : "c != STRING");
+		olen < l ? "len < l" : errflag ? "errflag" : "c != STRING");
 	fflush(stderr);
 	untokenize(s);
 	return 1;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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