about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-01 10:36:20 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-01 10:36:20 +0000
commite3618518fde961fc283bffceeb804e63d45c84ce (patch)
tree7922b3726de8a8b3de28fc287875261c03edcd28
parent137c94144cb236363f7af4ac86801fefde96d495 (diff)
downloadzsh-e3618518fde961fc283bffceeb804e63d45c84ce.tar.gz
zsh-e3618518fde961fc283bffceeb804e63d45c84ce.tar.xz
zsh-e3618518fde961fc283bffceeb804e63d45c84ce.zip
zsh-workers/9948
-rw-r--r--Src/exec.c12
-rw-r--r--Src/parse.c2
2 files changed, 4 insertions, 10 deletions
diff --git a/Src/exec.c b/Src/exec.c
index df42bad32..f242ab7aa 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3413,15 +3413,9 @@ stripkshdef(Eprog prog, char *name)
 	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 @@ stripkshdef(Eprog prog, char *name)
 	    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 @@ stripkshdef(Eprog prog, char *name)
 	ret->npats = npats;
 	for (i = npats; i--; pp++)
 	    *pp = dummy_patprog1;
-	ret->strs = (char *) (ret->prog + nprg);
 	ret->shf = NULL;
 
 	return ret;
diff --git a/Src/parse.c b/Src/parse.c
index 0b11668c2..fb20944c2 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2619,7 +2619,7 @@ try_dump_file(char *dump, char *name, char *func)
 
 	    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;