summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-05-01 02:36:27 +0000
committertjr <tjr@FreeBSD.org>2003-05-01 02:36:27 +0000
commitddbd6efafac8dddf586511da6b15194011d3edd0 (patch)
tree37cb7506bb24e3151423305af8246b7378b1ca30 /usr.bin/m4
parentd39162a421d8ef7acc51718e21c1b987cb529aeb (diff)
downloadFreeBSD-src-ddbd6efafac8dddf586511da6b15194011d3edd0.zip
FreeBSD-src-ddbd6efafac8dddf586511da6b15194011d3edd0.tar.gz
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.
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 37ccc35..6d2d0fde 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -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:
OpenPOWER on IntegriCloud