From e6f90ecc27f5d305a0e755da67db75da786f4568 Mon Sep 17 00:00:00 2001 From: Anthony Ferrara Date: Tue, 2 Jul 2013 09:46:30 -0400 Subject: It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh --- sapi/cli/php_cli.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 9f3fc4b5b7..164986f633 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - size_t ret; + zend_str_size ret; #endif if (cli_shell_callbacks.cli_shell_write) { - size_t shell_wrote; + zend_str_size shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS } /* }}} */ -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - uint remaining = str_length; + zend_str_size remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ } if (cli_shell_callbacks.cli_shell_ub_write) { - int ub_wrote; + zend_str_size ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - unsigned int len; + zend_str_size len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -619,7 +619,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st /* {{{ cli_seek_file_begin */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) +static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, zend_str_size_int *lineno TSRMLS_DC) { int c; @@ -670,7 +670,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ char *arg_free=NULL, **arg_excp=&arg_free; char *script_file=NULL, *translated_path = NULL; int interactive=0; - int lineno = 0; + zend_str_size lineno = 0; const char *param_error=NULL; int hide_argv = 0; @@ -1059,7 +1059,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } ALLOC_ZVAL(argn); Z_TYPE_P(argn) = IS_STRING; - Z_STRLEN_P(argn) = ++len; + Z_STRSIZE_P(argn) = ++len; Z_STRVAL_P(argn) = estrndup(input, len); INIT_PZVAL(argn); zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); @@ -1214,7 +1214,7 @@ int main(int argc, char *argv[]) int php_optind = 1, use_extended_info = 0; char *ini_path_override = NULL; char *ini_entries = NULL; - int ini_entries_len = 0; + zend_str_size ini_entries_len = 0; int ini_ignore = 0; sapi_module_struct *sapi_module = &cli_sapi_module; @@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) break; case 'd': { /* define ini entries on command line */ - int len = strlen(php_optarg); + zend_str_size len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { -- cgit v1.2.1 From 010b8114cc7d71c0957ff0a77e9d2c1cfe16e9f3 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 29 Jul 2013 02:39:44 -0700 Subject: more for cli sapi --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 164986f633..c343f5496e 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1143,7 +1143,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } case PHP_MODE_REFLECTION_EXT_INFO: { - int len = strlen(reflection_what); + zend_str_size_int len = strlen(reflection_what); char *lcname = zend_str_tolower_dup(reflection_what, len); zend_module_entry *module; -- cgit v1.2.1 From b1abe4ca21e10b04a8bae2d00e8113f4b2b02567 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 18 Dec 2013 14:46:44 -0800 Subject: mass replacement for zend_size_t/php_size_t --- sapi/cli/php_cli.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 4cc91d6772..8f6522a71d 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - zend_str_size ret; + php_size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { - zend_str_size shell_wrote; + php_size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str } /* }}} */ -static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ +static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - zend_str_size remaining = str_length; + php_size_t remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint s } if (cli_shell_callbacks.cli_shell_ub_write) { - zend_str_size ub_wrote; + php_size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - zend_str_size len; + php_size_t len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -619,7 +619,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st /* {{{ cli_seek_file_begin */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, zend_str_size_int *lineno TSRMLS_DC) +static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, php_size_t *lineno TSRMLS_DC) { int c; @@ -670,7 +670,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ char *arg_free=NULL, **arg_excp=&arg_free; char *script_file=NULL, *translated_path = NULL; int interactive=0; - zend_str_size lineno = 0; + php_size_t lineno = 0; const char *param_error=NULL; int hide_argv = 0; @@ -1143,7 +1143,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } case PHP_MODE_REFLECTION_EXT_INFO: { - zend_str_size_int len = strlen(reflection_what); + php_size_t len = strlen(reflection_what); char *lcname = zend_str_tolower_dup(reflection_what, len); zend_module_entry *module; @@ -1214,7 +1214,7 @@ int main(int argc, char *argv[]) int php_optind = 1, use_extended_info = 0; char *ini_path_override = NULL; char *ini_entries = NULL; - zend_str_size ini_entries_len = 0; + php_size_t ini_entries_len = 0; int ini_ignore = 0; sapi_module_struct *sapi_module = &cli_sapi_module; @@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) break; case 'd': { /* define ini entries on command line */ - zend_str_size len = strlen(php_optarg); + php_size_t len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { -- cgit v1.2.1 From f58d0b35edf25a8f39fad6bd5e0e4eeb5cdfe9a7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 19 Dec 2013 05:07:37 -0800 Subject: massive update semantical LONG vs INT replacements --- sapi/cli/php_cli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 8f6522a71d..f4bd529127 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1048,8 +1048,8 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ exit_status=254; } ALLOC_ZVAL(argi); - Z_TYPE_P(argi) = IS_LONG; - Z_LVAL_P(argi) = index; + Z_TYPE_P(argi) = IS_INT; + Z_IVAL_P(argi) = index; INIT_PZVAL(argi); zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { @@ -1063,7 +1063,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ Z_STRVAL_P(argn) = estrndup(input, len); INIT_PZVAL(argn); zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); - Z_LVAL_P(argi) = ++index; + Z_IVAL_P(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; -- cgit v1.2.1 From cb25136f4ef1042295650475b2c20ace81e2b9b7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 16 Aug 2014 11:37:14 +0200 Subject: fix macros in the 5 basic extensions --- sapi/cli/php_cli.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index ec76f37715..92ec58b25f 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - size_t ret; + php_size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { - size_t shell_wrote; + php_size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS } /* }}} */ -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - uint remaining = str_length; + php_size_t remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ } if (cli_shell_callbacks.cli_shell_ub_write) { - int ub_wrote; + php_size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - unsigned int len; + php_size_t len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -1033,7 +1033,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } - ZVAL_LONG(&argi, index); + ZVAL_INT(&argi, index); zend_hash_str_update(&EG(symbol_table).ht, "argi", sizeof("argi")-1, &argi); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); @@ -1042,7 +1042,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } ZVAL_STRINGL(&argn, input, len); zend_hash_str_update(&EG(symbol_table).ht, "argn", sizeof("argn")-1, &argn); - Z_LVAL(argi) = ++index; + Z_IVAL(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; -- cgit v1.2.1 From 41115d3d9dc1f7116ac2d1bb7087a24098885a03 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 17 Aug 2014 21:05:20 +0200 Subject: regenerated parser files --- sapi/cli/php_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 92ec58b25f..bdc4629c08 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,10 +252,10 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT - long ret; + php_int_t ret; #else php_size_t ret; #endif -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- sapi/cli/php_cli.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index bdc4629c08..c51e5a8ce2 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -255,7 +255,7 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) PHP_CLI_API size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT - php_int_t ret; + zend_long ret; #else php_size_t ret; #endif @@ -425,7 +425,7 @@ static int php_cli_startup(sapi_module_struct *sapi_module) /* {{{ */ /* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */ #define INI_DEFAULT(name,value)\ - ZVAL_NEW_STR(&tmp, STR_INIT(value, sizeof(value)-1, 1));\ + ZVAL_NEW_STR(&tmp, zend_string_init(value, sizeof(value)-1, 1));\ zend_hash_str_update(configuration_hash, name, sizeof(name)-1, &tmp);\ static void sapi_cli_ini_defaults(HashTable *configuration_hash) @@ -581,19 +581,19 @@ static void cli_register_file_handles(TSRMLS_D) /* {{{ */ ZVAL_COPY_VALUE(&ic.value, &zin); ic.flags = CONST_CS; - ic.name = STR_INIT("STDIN", sizeof("STDIN")-1, 1); + ic.name = zend_string_init("STDIN", sizeof("STDIN")-1, 1); ic.module_number = 0; zend_register_constant(&ic TSRMLS_CC); ZVAL_COPY_VALUE(&oc.value, &zout); oc.flags = CONST_CS; - oc.name = STR_INIT("STDOUT", sizeof("STDOUT")-1, 1); + oc.name = zend_string_init("STDOUT", sizeof("STDOUT")-1, 1); oc.module_number = 0; zend_register_constant(&oc TSRMLS_CC); ZVAL_COPY_VALUE(&ec.value, &zerr); ec.flags = CONST_CS; - ec.name = STR_INIT("STDERR", sizeof("STDERR")-1, 1); + ec.name = zend_string_init("STDERR", sizeof("STDERR")-1, 1); ec.module_number = 0; zend_register_constant(&ec TSRMLS_CC); } @@ -963,9 +963,9 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } } - key = STR_INIT("_SERVER", sizeof("_SERVER")-1, 0); + key = zend_string_init("_SERVER", sizeof("_SERVER")-1, 0); zend_is_auto_global(key TSRMLS_CC); - STR_RELEASE(key); + zend_string_release(key); PG(during_request_startup) = 0; switch (behavior) { @@ -1033,7 +1033,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } - ZVAL_INT(&argi, index); + ZVAL_LONG(&argi, index); zend_hash_str_update(&EG(symbol_table).ht, "argi", sizeof("argi")-1, &argi); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); @@ -1042,7 +1042,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } ZVAL_STRINGL(&argn, input, len); zend_hash_str_update(&EG(symbol_table).ht, "argn", sizeof("argn")-1, &argn); - Z_IVAL(argi) = ++index; + Z_LVAL(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; -- cgit v1.2.1 From 4d997f63d98c663b2d9acccd3655572652f61c7d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:22:49 +0200 Subject: master renames phase 3 --- sapi/cli/php_cli.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index c51e5a8ce2..5847849e89 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT zend_long ret; #else - php_size_t ret; + size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { - php_size_t shell_wrote; + size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, php_size_t str_length } /* }}} */ -static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ +static size_t sapi_cli_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - php_size_t remaining = str_length; + size_t remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRML } if (cli_shell_callbacks.cli_shell_ub_write) { - php_size_t ub_wrote; + size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - php_size_t len; + size_t len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server -- cgit v1.2.1 From 59848e3fbbcab3144c4d711df5d5be39cca51269 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 25 Aug 2014 23:45:02 +0200 Subject: Remove ZEND_ACC_INTERACTIVE and CG(interactive) As far as I can discern these are leftovers of the interactive shell implementation that was used before PHP 5.4. Now the readline ext makes use of normal eval calls for this. So, dropping these until there is evidence to the contrary, as they currently wouldn't work anyway. --- sapi/cli/php_cli.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 5847849e89..2e714c4a90 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -902,8 +902,6 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ fflush(stdout); } - CG(interactive) = interactive; - /* only set script_file if not set already and not in direct mode and not at end of parameter list */ if (argc > php_optind && !script_file -- cgit v1.2.1 From 534ee969649fc0a4d9c9a9467a616a6fab7acdbe Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 14 Sep 2014 23:03:13 +0200 Subject: fix ftell/fseek calls --- sapi/cli/php_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2e714c4a90..f3eec80283 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -627,8 +627,8 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (fgetc(file_handle->handle.fp) != '\n') { - long pos = ftell(file_handle->handle.fp); - fseek(file_handle->handle.fp, pos - 1, SEEK_SET); + zend_long pos = zend_ftell(file_handle->handle.fp); + zend_fseek(file_handle->handle.fp, pos - 1, SEEK_SET); } } *lineno = 2; -- cgit v1.2.1