From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: stripkshdef()
Date: Wed, 1 Mar 2000 11:31:36 +0100 (MET) [thread overview]
Message-ID: <200003011031.LAA25918@beta.informatik.hu-berlin.de> (raw)
This is only partly a follow-up to 9947... stripkshdef() was broken
after the optimisation test that made some lists and sublists be
simplified.
And then there was a thinko in the code for reading a function from a
wordcode file.
Bye
Sven
diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c Wed Mar 1 11:06:38 2000
+++ Src/exec.c Wed Mar 1 11:27:13 2000
@@ -3413,15 +3413,9 @@
return NULL;
code = *pc++;
if (wc_code(code) != WC_LIST ||
- (WC_LIST_TYPE(code) & (Z_SYNC|Z_END)) != (Z_SYNC|Z_END))
- return prog;
- code = *pc++;
- if (wc_code(code) != WC_SUBLIST ||
- WC_SUBLIST_FLAGS(code) || WC_SUBLIST_TYPE(code) != WC_SUBLIST_END)
- return prog;
- code = *pc++;
- if (wc_code(code) != WC_PIPE || WC_PIPE_TYPE(code) != WC_PIPE_END)
+ (WC_LIST_TYPE(code) & (Z_SYNC|Z_END|Z_SIMPLE)) != (Z_SYNC|Z_END|Z_SIMPLE))
return prog;
+ pc++;
code = *pc++;
if (wc_code(code) != WC_FUNCDEF ||
*pc != 1 || strcmp(name, ecrawstr(prog, pc + 1, NULL)))
@@ -3450,6 +3444,7 @@
ret->alloc = EA_HEAP;
ret->pats = pp = (Patprog *) zhalloc(len);
ret->prog = (Wordcode) (ret->pats + npats);
+ ret->strs = (char *) (ret->prog + nprg);
memcpy(ret->prog, pc, plen);
memcpy(ret->strs, prog->strs + sbeg, nstrs);
ret->dump = NULL;
@@ -3458,7 +3453,6 @@
ret->npats = npats;
for (i = npats; i--; pp++)
*pp = dummy_patprog1;
- ret->strs = (char *) (ret->prog + nprg);
ret->shf = NULL;
return ret;
diff -ru ../z.old/Src/parse.c Src/parse.c
--- ../z.old/Src/parse.c Wed Mar 1 11:06:40 2000
+++ Src/parse.c Wed Mar 1 11:27:31 2000
@@ -2619,7 +2619,7 @@
prog = (Eprog) zalloc(sizeof(*prog));
- prog->alloc = EA_MAP;
+ prog->alloc = EA_REAL;
prog->len = h->len + po;
prog->npats = np = h->npats;
prog->pats = pp = (Patprog *) d;
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~2000-03-01 10:31 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=200003011031.LAA25918@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).