@@ -91,7 +91,7 @@ static size_t strip_trailing_whitespace(char *buf, size_t bufl) {
91
91
return bufl ;
92
92
}
93
93
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 ) {
95
95
if (type == 1 ) {
96
96
PHPWRITE (buf , bufl );
97
97
if (php_output_get_level () < 1 ) {
@@ -101,6 +101,7 @@ static void handle_line(int type, zval *array, char *buf, size_t bufl) {
101
101
bufl = strip_trailing_whitespace (buf , bufl );
102
102
add_next_index_stringl (array , buf , bufl );
103
103
}
104
+ return bufl ;
104
105
}
105
106
106
107
/* {{{ php_exec
@@ -160,13 +161,13 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
160
161
bufl += b - buf ;
161
162
}
162
163
163
- handle_line (type , array , buf , bufl );
164
+ bufl = handle_line (type , array , buf , bufl );
164
165
b = buf ;
165
166
}
166
167
if (bufl ) {
167
168
if (buf != b ) {
168
169
/* Process remaining output */
169
- handle_line (type , array , buf , bufl );
170
+ bufl = handle_line (type , array , buf , bufl );
170
171
}
171
172
172
173
/* Return last line from the shell command */
0 commit comments