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

Re: ${(z)} split of unmatched, doubled ((



On Sep 28,  1:55am, Daniel Shahaf wrote:
}
} If we can't prove that tokstr is always
} non-NULL, I would vote to test it for NULL before using it.  

OK, I'm going to commit it like this;

diff --git a/Src/lex.c b/Src/lex.c
index 70f3d14..89af961 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -783,6 +783,15 @@ gettok(void)
 		     */
 		    tokstr = NULL;
 		    return INPAR;
+		    
+		case CMD_OR_MATH_ERR:
+		    /*
+		     * LEXFLAGS_ACTIVE means we came from bufferwords(),
+		     * so we treat as an incomplete math expression
+		     */
+		    if (lexflags & LEXFLAGS_ACTIVE)
+			tokstr = dyncat("((", tokstr ? tokstr : "");
+		    /* fall through */
 
 		default:
 		    return LEXERR;



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