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



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to