]>
Commit | Line | Data |
---|---|---|
fb98beff ER |
1 | --- PHP_5_3/ext/standard/file.c 2011/05/29 09:23:08 311542 |
2 | +++ PHP_5_3/ext/standard/file.c 2011/05/29 10:23:06 311543 | |
3 | @@ -2196,30 +2196,17 @@ | |
4 | char *comp_end, *hunk_begin; | |
5 | ||
6 | tptr = temp; | |
7 | - | |
8 | - /* 1. Strip any leading space */ | |
9 | - for (;;) { | |
10 | - inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0); | |
11 | - switch (inc_len) { | |
12 | - case -2: | |
13 | - case -1: | |
14 | - inc_len = 1; | |
15 | - php_mblen(NULL, 0); | |
16 | - break; | |
17 | - case 0: | |
18 | - goto quit_loop_1; | |
19 | - case 1: | |
20 | - if (!isspace((int)*(unsigned char *)bptr) || *bptr == delimiter) { | |
21 | - goto quit_loop_1; | |
22 | - } | |
23 | - break; | |
24 | - default: | |
25 | - goto quit_loop_1; | |
26 | + inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0); | |
27 | + if (inc_len == 1) { | |
28 | + char *tmp = bptr; | |
29 | + while (isspace((int)*(unsigned char *)tmp)) { | |
30 | + tmp++; | |
31 | + } | |
32 | + if (*tmp == enclosure) { | |
33 | + bptr = tmp; | |
34 | } | |
35 | - bptr += inc_len; | |
36 | } | |
37 | ||
38 | - quit_loop_1: | |
39 | if (first_field && bptr == line_end) { | |
40 | add_next_index_null(return_value); | |
41 | break; |