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

Re: Is "read -AE" buggy?



I think I should be a bit more careful in the non '-A' case.

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.253
diff -p -u -r1.253 builtin.c
--- Src/builtin.c	28 Aug 2011 17:06:27 -0000	1.253
+++ Src/builtin.c	29 Aug 2011 17:05:24 -0000
@@ -5549,7 +5549,14 @@ bin_read(char *name, char **args, Option
 	*bptr = '\0';
 #endif
 	/* dispose of word appropriately */
-	if (OPT_ISSET(ops,'e')) {
+	if (OPT_ISSET(ops,'e') ||
+	    /*
+	     * When we're doing an array assignment, we'll
+	     * handle echoing at that point.  In all other
+	     * cases (including -A with no assignment)
+	     * we'll do it here.
+	     */
+	    (OPT_ISSET(ops,'E') && !OPT_ISSET(ops,'A'))) {
 	    zputs(buf, stdout);
 	    putchar('\n');
 	}


-- 
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