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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190698

View File

@ -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();