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

Re: Another crash bug in "print"



On Fri, Mar 28, 2003 at 05:35:10PM +0000, Bart Schaefer wrote:
> zagzig% print -m
> zsh: segmentation fault (core dumped)  Src/zsh -f

This looks like the right fix to me:

Index: Src/builtin.c
--- Src/builtin.c	17 Feb 2003 10:08:03 -0000	1.97
+++ Src/builtin.c	28 Mar 2003 18:21:25 -0000
@@ -3111,7 +3111,11 @@
     if (OPT_ISSET(ops,'m')) {
 	Patprog pprog;
 	char **t, **p;
-	
+
+	if (!*args) {
+	    zwarnnam(name, "no pattern specified", NULL, 0);
+	    return 1;
+	}
 	tokenize(*args);
 	if (!(pprog = patcompile(*args, PAT_STATIC, NULL))) {
 	    untokenize(*args);

..wayne..



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