@@ -91,7 +91,7 @@ static size_t strip_trailing_whitespace(char *buf, size_t bufl) {
9191 return bufl ;
9292}
9393
94- static void handle_line (int type , zval * array , char * buf , size_t bufl ) {
94+ static size_t handle_line (int type , zval * array , char * buf , size_t bufl ) {
9595 if (type == 1 ) {
9696 PHPWRITE (buf , bufl );
9797 if (php_output_get_level () < 1 ) {
@@ -101,6 +101,7 @@ static void handle_line(int type, zval *array, char *buf, size_t bufl) {
101101 bufl = strip_trailing_whitespace (buf , bufl );
102102 add_next_index_stringl (array , buf , bufl );
103103 }
104+ return bufl ;
104105}
105106
106107/* {{{ php_exec
@@ -160,13 +161,13 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
160161 bufl += b - buf ;
161162 }
162163
163- handle_line (type , array , buf , bufl );
164+ bufl = handle_line (type , array , buf , bufl );
164165 b = buf ;
165166 }
166167 if (bufl ) {
167168 if (buf != b ) {
168169 /* Process remaining output */
169- handle_line (type , array , buf , bufl );
170+ bufl = handle_line (type , array , buf , bufl );
170171 }
171172
172173 /* Return last line from the shell command */
0 commit comments