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

PATCH: bad variable declarations



One sign the shell isn't getting compiled widely enough.

Index: Src/text.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/text.c,v
retrieving revision 1.27
diff -p -u -r1.27 text.c
--- Src/text.c	6 Jan 2011 20:28:50 -0000	1.27
+++ Src/text.c	9 May 2011 10:22:59 -0000
@@ -893,13 +893,13 @@ getredirs(LinkList redirs)
 		    taddstr(f->here_terminator);
 		    taddpending(f->name, f->munged_here_terminator);
 		} else {
+		    int fnamelen, sav;
 		    taddstr(fstr[REDIR_HERESTR]);
 		    /*
 		     * Just a quick and dirty representation.
 		     * Remove a terminating newline, if any.
 		     */
-		    int fnamelen = strlen(f->name);
-		    int sav;
+		    fnamelen = strlen(f->name);
 		    if (fnamelen > 0 && f->name[fnamelen-1] == '\n') {
 			sav = 1;
 			f->name[fnamelen-1] = '\0';

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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