← Commit list

493b9cae8

Denys Vlasenko
Denys Vlasenko
2016-10-30
SUCCESS Duration: 207s

Subject

ash: make popfile() anfter popallfiles() safe

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+5 -2
@@ -10125,6 +10125,9 @@ popfile(void)
{
struct parsefile *pf = g_parsefile;
+ if (pf == &basepf)
+ return;
+
INT_OFF;
if (pf->pf_fd >= 0)
close(pf->pf_fd);
@@ -12286,7 +12289,7 @@ expandstr(const char *ps)
static int
evalstring(char *s, int flags)
{
- struct jmploc *volatile savehandler = exception_handler;
+ struct jmploc *volatile savehandler;
struct jmploc jmploc;
int ex;
@@ -12307,10 +12310,10 @@ evalstring(char *s, int flags)
* But if we skip popfile(), we hit EOF in eval's string, and exit.
*/
savehandler = exception_handler;
- exception_handler = &jmploc;
ex = setjmp(jmploc.loc);
if (ex)
goto out;
+ exception_handler = &jmploc;
while ((n = parsecmd(0)) != NODE_EOF) {
int i;