zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Very serious bug: Bad pattern in precmd()
@ 2001-06-30 17:57 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2001-06-30 17:57 UTC (permalink / raw)
  To: zsh-workers

Try this only in a debugger or if you have another shell from which you
can kill the first one:

zsh% precmd() { echo [[ }

Zsh goes into an infinite loop printing `precmd: bad pattern: [['.  This
does not happen in 3.0.8, but does happen in 3.1.9 (which is the oldest
3.1.x binary I have around).

This appears to have resulted from moving hbegin() to above preprompt()
in loop() -- hbegin() has the side-effect of resetting `errflag = 0'.
This was my fault, all the way back in article 10168, so it's been around
since 3.1.6-dev-20 without anyone catching it.

Index: Src/init.c
===================================================================
diff -c -r1.3 init.c
--- Src/init.c	2001/04/21 22:22:53	1.3
+++ Src/init.c	2001/06/30 17:51:19
@@ -107,7 +107,6 @@
     pushheap();
     for (;;) {
 	freeheap();
-	errflag = 0;
 	hbegin(1);		/* init history mech        */
 	if (isset(SHINSTDIN)) {
 	    setblock_stdin();
@@ -116,6 +115,7 @@
 		stophist = 3;
 		preprompt();
 		stophist = hstop;
+		errflag = 0;
 	    }
 	}
 	intr();			/* interrupts on            */

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-06-30 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-30 17:57 PATCH: Very serious bug: Bad pattern in precmd() Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).