* PATCH: stripkshdef()
@ 2000-03-01 10:31 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-03-01 10:31 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-03-01 10:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-01 10:31 PATCH: stripkshdef() Sven Wischnowsky
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).