moriyoshi               Sun Jan 18 15:29:35 2004 EDT

  Modified files:              
    /php-src/ext/standard       file.c 
  Log:
  Fix fgetcsv() to reflect the change on 4.3.5 behaviour.
  
  
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.376 php-src/ext/standard/file.c:1.377
--- php-src/ext/standard/file.c:1.376   Wed Jan 14 09:37:38 2004
+++ php-src/ext/standard/file.c Sun Jan 18 15:29:34 2004
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.376 2004/01/14 14:37:38 wez Exp $ */
+/* $Id: file.c,v 1.377 2004/01/18 20:29:34 moriyoshi Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1904,6 +1904,7 @@
                                                                        /* real 
enclosure */
                                                                        memcpy(tptr, 
hunk_begin, bptr - hunk_begin - 1);
                                                                        tptr += (bptr 
- hunk_begin - 1);
+                                                                       hunk_begin = 
bptr;
                                                                        goto 
quit_loop_2;
                                                                }
                                                                memcpy(tptr, 
hunk_begin, bptr - hunk_begin);
@@ -1929,6 +1930,7 @@
                                                                /* real enclosure */
                                                                memcpy(tptr, 
hunk_begin, bptr - hunk_begin - 1);
                                                                tptr += (bptr - 
hunk_begin - 1);
+                                                               hunk_begin = bptr;
                                                                goto quit_loop_2;
                                                        case 1:
                                                                bptr += inc_len;
@@ -1959,7 +1961,6 @@
                                                /* break is omitted intentionally */
                                        case 1:
                                                if (*bptr == delimiter) {
-                                                       bptr += inc_len;
                                                        goto quit_loop_3;
                                                }
                                                break;
@@ -1971,6 +1972,9 @@
                        }
 
                quit_loop_3:
+                       memcpy(tptr, hunk_begin, bptr - hunk_begin);
+                       tptr += (bptr - hunk_begin);
+                       bptr += inc_len;
                        comp_end = tptr;
                } else {
                        /* 2B. Handle non-enclosure field */

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

Reply via email to