arg_zero.patch   [plain text]


--- Src/init.c	2007-01-30 10:42:55.000000000 -0800
+++ Src/init.c	2007-05-14 13:42:58.000000000 -0700
@@ -1430,7 +1430,7 @@
 
 /**/
 mod_export int
-zsh_main(UNUSED(int argc), char **argv)
+zsh_main(int argc, char **argv)
 {
     char **t, *runscript = NULL;
     int t0;
@@ -1438,6 +1438,12 @@
     setlocale(LC_ALL, "");
 #endif
 
+    if (argc < 1) {
+	argzero = "zsh";
+	zerr("too few arguments", NULL, 0);
+	exit(1);
+    }
+
     init_jobs(argv, environ);
 
     /*