Don't let trailing empty lines overwrite the result of the last command with 0.
This affects the built-ins eval, fc, and trap and also the string passed to sh with the -c option. Submitted by: Jilles Tjoelker
This commit is contained in:
parent
bb6418cbe3
commit
8403b16a59
@ -166,7 +166,8 @@ evalstring(char *s)
|
||||
setstackmark(&smark);
|
||||
setinputstring(s, 1);
|
||||
while ((n = parsecmd(0)) != NEOF) {
|
||||
evaltree(n, 0);
|
||||
if (n != NULL)
|
||||
evaltree(n, 0);
|
||||
popstackmark(&smark);
|
||||
}
|
||||
popfile();
|
||||
|
Loading…
Reference in New Issue
Block a user