Browse Source

fix ftell/fseek calls

pull/822/head
Anatol Belski 12 years ago
parent
commit
534ee96964
  1. 4
      sapi/cli/php_cli.c

4
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;

Loading…
Cancel
Save