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

PATCH: 3.0.5: Re: PATCH: 3.1.5-pws-4: compilation warnings



On Jan 20,  4:34pm, Peter Stephenson wrote:
} Subject: PATCH: 3.1.5-pws-4: compilation warnings
}
} One of the dangling `else' branches in hist.c actually appeared to be
} a bug, with the logic not agreeing with the indentation.

That sure looks like a bug to me, and 3.0.x has apparently had it too,
since as long ago as I've kept a copy in CVS.  Here's the patch for that
one bug, against 3.0.5.

Index: Src/hist.c
===================================================================
--- hist.c	1998/07/02 15:56:02	1.8
+++ hist.c	1999/01/24 17:13:23
@@ -304,7 +304,7 @@
 		c = ingetc();
 	    }
 	    *ptr = 0;
-	    if (!*buf)
+	    if (!*buf) {
 		if (c != '%') {
 		    if (isset(CSHJUNKIEHISTORY))
 			ev = curhist - 1;
@@ -320,6 +320,7 @@
 		    else
 			ev = defev;
 		    evset = 0;
+		}
 	    } else if ((t0 = atoi(buf))) {
 		ev = (t0 < 0) ? curhist + t0 : t0;
 		evset = 1;

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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