Flush streams before calling system() so that the output appears in the

right place in the output stream when redirected to a file (when full
buffering is enabled). Noticed by schweikh on freebsd-standards.
This commit is contained in:
Tim J. Robbins 2003-05-01 02:36:27 +00:00
parent b52e9eb6b6
commit aef4bb33e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114368

View File

@ -241,8 +241,10 @@ expand_builtin(const char *argv[], int argc, int td)
/*
* dosys - execute system command
*/
if (argc > 2)
if (argc > 2) {
fflush(NULL);
sysval = system(argv[2]);
}
break;
case SYSVTYPE: