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

Re: PATCH: exit after 10 EOF's



On Sun, 19 Sep 2004, Bart Schaefer wrote:

> I haven't gotten to the latter part yet, but here's a patch that (a) backs 
> out 20363 and (b) causes the count to apply to printing of the warning.

Actually I just noticed that it doesn't _completely_ back out 20363.  This
part of 20363 is still there:

 	bindk = getkeycmd();
-	if (!ll && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) &&
-	    lastchar == eofchar) {
-	    eofsent = 1;
-	    break;
-	}
 	if (bindk) {
-	    if (execzlefunc(bindk, zlenoargs))
+	    if (!ll && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) &&
+		lastchar == eofchar) {
+		/*
+		 * Slight hack: this relies on getkeycmd returning
+		 * a value for the EOF character.  However,
+		 * undefined-key is fine.  That's necessary because
+		 * otherwise we can't distinguish this case from
+		 * a ^C.
+		 */
+		eofsent = 1;
+		break;
+	    }
+	    if (execzlefunc(bindk, zlenoargs)) {


However, I can't figure out when getkeycmd() might fail to return a value 
for the EOF character, so I can't decide whether this makes a difference.



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