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

PATCH: Re: side effect of promptsubst.



Tanaka Akira wrote:

> Z(4):akr@serein% zsh -f
> serein% setopt promptsubst
> serein% print -lr - ' 
> quote> aaaaaaaaaaaaaaaaaaaaaaaaaaabcdddddddd'
>  
> aaaaaaaaaaaaaaaaaaaaaaaaaaab
> serein%
> 
> The argument is truncated.  This problem doesn't arised without
> promptsubst.

Missing save/restore for one of the variables used during lexing.

Bye
 Sven

Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.3
diff -u -r1.3 lex.c
--- Src/lex.c	2000/04/06 17:21:52	1.3
+++ Src/lex.c	2000/05/04 08:41:03
@@ -178,6 +178,7 @@
     char *yytext;
     char *bptr;
     int bsiz;
+    int len;
     short *chwords;
     int chwordlen;
     int chwordpos;
@@ -236,6 +237,7 @@
     ls->yytext = yytext;
     ls->bptr = bptr;
     ls->bsiz = bsiz;
+    ls->len = len;
     ls->chwords = chwords;
     ls->chwordlen = chwordlen;
     ls->chwordpos = chwordpos;
@@ -296,6 +298,7 @@
     yytext = lstack->yytext;
     bptr = lstack->bptr;
     bsiz = lstack->bsiz;
+    len = lstack->len;
     chwords = lstack->chwords;
     chwordlen = lstack->chwordlen;
     chwordpos = lstack->chwordpos;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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