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

PATCH: remove dead code in execbuiltin



This occurs within a while loop inside an if(optstr), and within
the loop, the only modification to optstr is potentially to set it to
"ne", in which case it is still set, so therefore the "else p++"
cannot happen.

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.211
diff -u -r1.211 builtin.c
--- Src/builtin.c	6 Oct 2008 18:15:36 -0000	1.211
+++ Src/builtin.c	14 Oct 2008 21:42:51 -0000
@@ -313,10 +313,7 @@
 		*/
 		if (flags & BINF_SKIPINVALID) {
 		    char *p = arg;
-		    if (optstr)
-			while (*++p && strchr(optstr, (int) *p));
-		    else
-			p++;
+		    while (*++p && strchr(optstr, (int) *p));
 		    if (*p)
 			break;
 		}



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