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

PATCH: Re: Syntax error on "function ..." causes crash



Bart Schaefer wrote:

> zagzig% function
> function> :
> 
> Program received signal SIGSEGV, Segmentation fault.

This makes it be silent, as in 3.0.8.

Bye
 Sven

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.17
diff -u -r1.17 exec.c
--- Src/exec.c	2000/08/08 14:57:03	1.17
+++ Src/exec.c	2000/08/28 07:02:34
@@ -3070,7 +3070,10 @@
     LinkList names;
 
     end = beg + WC_FUNCDEF_SKIP(state->pc[-1]);
-    names = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
+    if (!(names = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok))) {
+	state->pc = end;
+	return 0;
+    }
     nprg = end - beg;
     sbeg = *state->pc++;
     nstrs = *state->pc++;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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