summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index cdf983787b..3b0e0a034f 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -157,6 +157,13 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
b = buf;
}
if (bufl) {
+ /* output remaining data in buffer */
+ if (type == 1 && buf != b) {
+ PHPWRITE(buf, bufl);
+ if (php_output_get_level() < 1) {
+ sapi_flush();
+ }
+ }
/* strip trailing whitespaces if we have not done so already */
if ((type == 2 && buf != b) || type != 2) {
l = bufl;