zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: WC_ENDs
Date: Fri, 25 Feb 2000 16:12:53 +0100 (MET)	[thread overview]
Message-ID: <200002251512.QAA27546@beta.informatik.hu-berlin.de> (raw)


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


                 reply	other threads:[~2000-02-25 15:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200002251512.QAA27546@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).