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:
parent
b52e9eb6b6
commit
aef4bb33e5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114368
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user