Browse Source

MFH: fix #37920 (compilation problems on z/OS)

PECL_OPENSSL
Antony Dovgal 20 years ago
parent
commit
6c52ec1319
  1. 6
      sapi/cgi/cgi_main.c
  2. 6
      sapi/cli/php_cli.c

6
sapi/cgi/cgi_main.c

@ -1588,12 +1588,12 @@ consult the installation file that came with this distribution, or visit \n\
/* #!php support */
c = fgetc(file_handle.handle.fp);
if (c == '#') {
while (c != 10 && c != 13) {
while (c != '\n' && c != '\r') {
c = fgetc(file_handle.handle.fp); /* skip to end of line */
}
/* handle situations where line is terminated by \r\n */
if (c == 13) {
if (fgetc(file_handle.handle.fp) != 10) {
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);
}

6
sapi/cli/php_cli.c

@ -545,12 +545,12 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
/* #!php support */
c = fgetc(file_handle->handle.fp);
if (c == '#') {
while (c != 10 && c != 13) {
while (c != '\n' && c != '\r') {
c = fgetc(file_handle->handle.fp); /* skip to end of line */
}
/* handle situations where line is terminated by \r\n */
if (c == 13) {
if (fgetc(file_handle->handle.fp) != 10) {
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);
}

Loading…
Cancel
Save