From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12936 invoked from network); 25 Feb 2000 15:13:09 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Feb 2000 15:13:09 -0000 Received: (qmail 20986 invoked by alias); 25 Feb 2000 15:12:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9877 Received: (qmail 20969 invoked from network); 25 Feb 2000 15:12:54 -0000 Date: Fri, 25 Feb 2000 16:12:53 +0100 (MET) Message-Id: <200002251512.QAA27546@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: WC_ENDs Just found a bug report in one of the Debian lists. Running a function like: mycd() { builtin cd "$@" && echo "$PWD" } where the cd failed caused a core dump. This makes all functions have their WC_END code at the end to avoid that. Bye Sven diff -ru ../z.old/Src/parse.c Src/parse.c --- ../z.old/Src/parse.c Fri Feb 25 14:16:53 2000 +++ Src/parse.c Fri Feb 25 16:10:06 2000 @@ -1327,7 +1327,7 @@ if (tok == INBRACE) { yylex(); - par_save_list(&c); + par_list(&c); if (tok != OUTBRACE) { lineno += oldlineno; ecsoffs = sbeg; @@ -1343,8 +1343,9 @@ ecnpats = onp; YYERRORV(oecused); } else - par_save_list1(&c); + par_list1(&c); + ecadd(WCB_END()); ecbuf[p + num + 2] = ecused - num - p; ecbuf[p + num + 3] = ecnpats; ecbuf[p + 1] = num; @@ -1507,7 +1508,7 @@ int c = 0; yylex(); - par_save_list(&c); + par_list(&c); if (tok != OUTBRACE) { cmdpop(); lineno += oldlineno; @@ -1530,6 +1531,7 @@ } cmdpop(); + ecadd(WCB_END()); ecbuf[p + argc + 2] = ecused - argc - p; ecbuf[p + argc + 3] = ecnpats; -- Sven Wischnowsky wischnow@informatik.hu-berlin.de