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

PATCH: Infinite loop in `case' with xtrace



(Read all the way to the end, there are comments interspersed with patches.)

I just did

zsh% zstyle \* preserve-prefix \~///
zsh% ls ~///<C-x ?>

and _arguments went into an infinite loop.  At first I thought it was this:

Index: Completion/Base/Utility/_arguments
===================================================================
--- Completion/Base/Utility/_arguments	2001/09/05 15:22:28	1.6
+++ Completion/Base/Utility/_arguments	2001/10/23 14:56:53
@@ -183,6 +183,7 @@
   -w)  optarg=yes; shift;;
   -s)  singopt=(-s); shift;;
   -W)  alwopt=arg; shift;;
+  *)   break;;
   esac
 done

But when that didn't fix it I found it was really this, caused by 16041:

Index: Src/loop.c
===================================================================
--- Src/loop.c	2001/10/17 14:38:28	1.3
+++ Src/loop.c	2001/10/23 15:09:50
@@ -553,9 +553,8 @@
 	    printprompt4();
 	    fprintf(xtrerr, "case %s (%s)\n", word, pat2);
 	    fflush(xtrerr);
-	    state->pc++;
-	} else
-	    state->pc += 2;
+	}
+	state->pc += 2;
 
 	if (*spprog != dummy_patprog1 && *spprog != dummy_patprog2)
 	    pprog = *spprog;


I note that neither 16038 nor 16041 has been applied to the 4-0-patches
branch.  Are they not needed there?  (And if 16041 is needed, be sure to
apply the above as well.)

-- 
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   



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