diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-25 10:50:57 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-25 10:51:23 +0100 |
| commit | 2b3b7f5cd97f3fdcd4fcaada212101975a289d06 (patch) | |
| tree | 5ef1f483ad6b4eb77795eca77dc5aa0ca72d446c /ext/standard/exec.c | |
| parent | 534e15b4778fa1ad422192888385bf41587ae8b3 (diff) | |
| parent | c0840fec9c28bf0133391e4d0a9a4d8dbf4e9967 (diff) | |
| download | php-git-2b3b7f5cd97f3fdcd4fcaada212101975a289d06.tar.gz | |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
Diffstat (limited to 'ext/standard/exec.c')
| -rw-r--r-- | ext/standard/exec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index da8b5712cf..86b0a0a466 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -159,6 +159,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; |
