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

Re: BUG: Parser unwinding (lack thereof)



On May 6, 12:08am, Bart Schaefer wrote:
} Subject: BUG:  Parser unwinding (lack thereof)
}
} torch% print -l ${            
} braceparam> ^C
} torch% print -l ${
} braceparam braceparam> 

This seems to handle it:


diff --git a/Src/lex.c b/Src/lex.c
index c929bb9..5b6d3a6 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1345,8 +1345,11 @@ gettokstr(int c, int sub)
 	    break;
     }
   brk:
-    if (errflag)
+    if (errflag) {
+	while(bct-- >= in_brace_param)
+	    cmdpop();
 	return LEXERR;
+    }
     hungetc(c);
     if (unmatched)
 	zerr("unmatched %c", unmatched);



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