]>
Commit | Line | Data |
---|---|---|
1e5a36b5 MW |
1 | Index: squid/src/HttpHeaderTools.c |
2 | diff -c squid/src/HttpHeaderTools.c:1.32 squid/src/HttpHeaderTools.c:1.32.2.1 | |
3 | *** squid/src/HttpHeaderTools.c:1.32 Thu Sep 6 13:51:56 2001 | |
4 | --- squid/src/HttpHeaderTools.c Tue May 20 17:51:15 2003 | |
5 | *************** | |
6 | *** 244,249 **** | |
7 | --- 244,254 ---- | |
8 | strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos) | |
9 | { | |
10 | size_t len; | |
11 | + char delim[2][3] = | |
12 | + { | |
13 | + {'"', del, 0}, | |
14 | + {'"', '\\', 0}}; | |
15 | + int quoted = 0; | |
16 | assert(str && item && pos); | |
17 | if (*pos) { | |
18 | if (!**pos) /* end of string */ | |
19 | *************** | |
20 | *** 260,268 **** | |
21 | *pos += xcountws(*pos); | |
22 | *item = *pos; /* remember item's start */ | |
23 | /* find next delimiter */ | |
24 | ! *pos = strchr(*item, del); | |
25 | ! if (!*pos) /* last item */ | |
26 | ! *pos = *item + strlen(*item); | |
27 | len = *pos - *item; /* *pos points to del or '\0' */ | |
28 | /* rtrim */ | |
29 | while (len > 0 && xisspace((*item)[len - 1])) | |
30 | --- 265,284 ---- | |
31 | *pos += xcountws(*pos); | |
32 | *item = *pos; /* remember item's start */ | |
33 | /* find next delimiter */ | |
34 | ! do { | |
35 | ! *pos += strcspn(*pos, delim[quoted]); | |
36 | ! if (**pos == del) | |
37 | ! break; | |
38 | ! if (**pos == '"') { | |
39 | ! quoted = !quoted; | |
40 | ! *pos += 1; | |
41 | ! } | |
42 | ! if (quoted && **pos == '\\') { | |
43 | ! *pos += 1; | |
44 | ! if (**pos) | |
45 | ! *pos += 1; | |
46 | ! } | |
47 | ! } while (**pos); | |
48 | len = *pos - *item; /* *pos points to del or '\0' */ | |
49 | /* rtrim */ | |
50 | while (len > 0 && xisspace((*item)[len - 1])) |