diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index fc1b5d927..0c8480587 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -10125,6 +10125,9 @@ popfile(void) | |||
10125 | { | 10125 | { |
10126 | struct parsefile *pf = g_parsefile; | 10126 | struct parsefile *pf = g_parsefile; |
10127 | 10127 | ||
10128 | if (pf == &basepf) | ||
10129 | return; | ||
10130 | |||
10128 | INT_OFF; | 10131 | INT_OFF; |
10129 | if (pf->pf_fd >= 0) | 10132 | if (pf->pf_fd >= 0) |
10130 | close(pf->pf_fd); | 10133 | close(pf->pf_fd); |
@@ -12286,7 +12289,7 @@ expandstr(const char *ps) | |||
12286 | static int | 12289 | static int |
12287 | evalstring(char *s, int flags) | 12290 | evalstring(char *s, int flags) |
12288 | { | 12291 | { |
12289 | struct jmploc *volatile savehandler = exception_handler; | 12292 | struct jmploc *volatile savehandler; |
12290 | struct jmploc jmploc; | 12293 | struct jmploc jmploc; |
12291 | int ex; | 12294 | int ex; |
12292 | 12295 | ||
@@ -12307,10 +12310,10 @@ evalstring(char *s, int flags) | |||
12307 | * But if we skip popfile(), we hit EOF in eval's string, and exit. | 12310 | * But if we skip popfile(), we hit EOF in eval's string, and exit. |
12308 | */ | 12311 | */ |
12309 | savehandler = exception_handler; | 12312 | savehandler = exception_handler; |
12310 | exception_handler = &jmploc; | ||
12311 | ex = setjmp(jmploc.loc); | 12313 | ex = setjmp(jmploc.loc); |
12312 | if (ex) | 12314 | if (ex) |
12313 | goto out; | 12315 | goto out; |
12316 | exception_handler = &jmploc; | ||
12314 | 12317 | ||
12315 | while ((n = parsecmd(0)) != NODE_EOF) { | 12318 | while ((n = parsecmd(0)) != NODE_EOF) { |
12316 | int i; | 12319 | int i; |