Unidiff1 files changed, 0 insertions, 49 deletions
|
diff --git a/parsing.c b/parsing.c index 9a4a7a3..66e8b3d 100644 --- a/ parsing.c+++ b/ parsing.c |
|
@@ -10,51 +10,2 @@ |
10 | |
10 | |
11 | char *convert_query_hexchar(char *txt) |
| |
12 | { |
| |
13 | int d1, d2; |
| |
14 | if (strlen(txt) < 3) { |
| |
15 | *txt = '\0'; |
| |
16 | return txt-1; |
| |
17 | } |
| |
18 | d1 = hextoint(*(txt+1)); |
| |
19 | d2 = hextoint(*(txt+2)); |
| |
20 | if (d1<0 || d2<0) { |
| |
21 | strcpy(txt, txt+3); |
| |
22 | return txt-1; |
| |
23 | } else { |
| |
24 | *txt = d1 * 16 + d2; |
| |
25 | strcpy(txt+1, txt+3); |
| |
26 | return txt; |
| |
27 | } |
| |
28 | } |
| |
29 | |
| |
30 | int cgit_parse_query(char *txt, configfn fn) |
| |
31 | { |
| |
32 | char *t, *value = NULL, c; |
| |
33 | |
| |
34 | if (!txt) |
| |
35 | return 0; |
| |
36 | |
| |
37 | t = txt = xstrdup(txt); |
| |
38 | |
| |
39 | while((c=*t) != '\0') { |
| |
40 | if (c=='=') { |
| |
41 | *t = '\0'; |
| |
42 | value = t+1; |
| |
43 | } else if (c=='+') { |
| |
44 | *t = ' '; |
| |
45 | } else if (c=='%') { |
| |
46 | t = convert_query_hexchar(t); |
| |
47 | } else if (c=='&') { |
| |
48 | *t = '\0'; |
| |
49 | (*fn)(txt, value); |
| |
50 | txt = t+1; |
| |
51 | value = NULL; |
| |
52 | } |
| |
53 | t++; |
| |
54 | } |
| |
55 | if (t!=txt) |
| |
56 | (*fn)(txt, value); |
| |
57 | return 0; |
| |
58 | } |
| |
59 | |
| |
60 | /* |
11 | /* |
|