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:
Stefan Farfeleder 2009-04-04 19:06:52 +00:00
parent bb6418cbe3
commit 8403b16a59

View File

@ -166,6 +166,7 @@ evalstring(char *s)
setstackmark(&smark);
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
if (n != NULL)
evaltree(n, 0);
popstackmark(&smark);
}