cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c /sapi/cli php_cli.c
| From: | Ilia Alshanetsky | Date: | Wed, 08 Jan 2003 00:44:59 +0000 |
| Subject: | cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c /sapi/cli php_cli.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-17734@lists.php.net to get a copy of this message | ||
iliaa Tue Jan 7 19:44:59 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/sapi/cli php_cli.c
/php4/sapi/cgi cgi_main.c
Log:
MFH
Index: php4/sapi/cli/php_cli.c
diff -u php4/sapi/cli/php_cli.c:1.51.2.5 php4/sapi/cli/php_cli.c:1.51.2.6
--- php4/sapi/cli/php_cli.c:1.51.2.5 Tue Dec 31 11:27:07 2002
+++ php4/sapi/cli/php_cli.c Tue Jan 7 19:44:58 2003
@@ -697,6 +697,13 @@
while (c != 10 && c != 13) {
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) {
+ long pos = ftell(file_handle.handle.fp);
+ fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
+ }
+ }
CG(zend_lineno) = -2;
} else {
rewind(file_handle.handle.fp);
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.10 php4/sapi/cgi/cgi_main.c:1.190.2.11
--- php4/sapi/cgi/cgi_main.c:1.190.2.10 Tue Dec 31 11:27:05 2002
+++ php4/sapi/cgi/cgi_main.c Tue Jan 7 19:44:58 2003
@@ -1413,6 +1413,13 @@
while (c != 10 && c != 13) {
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) {
+ long pos = ftell(file_handle.handle.fp);
+ fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
+ }
+ }
CG(zend_lineno) = -2;
} else {
rewind(file_handle.handle.fp);