Unidiff1 files changed, 0 insertions, 26 deletions
|
diff --git a/cgit.c b/cgit.c index dc91125..5567859 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -52,34 +52,8 @@ char *cgit_query_head = NULL; |
52 | char *cgit_query_sha1 = NULL; |
52 | char *cgit_query_sha1 = NULL; |
53 | |
53 | |
54 | struct cacheitem cacheitem; |
54 | struct cacheitem cacheitem; |
55 | |
55 | |
56 | int cgit_parse_query(char *txt, configfn fn) |
| |
57 | { |
| |
58 | char *t, *value = NULL, c; |
| |
59 | |
| |
60 | if (!txt) |
| |
61 | return 0; |
| |
62 | |
| |
63 | t = txt = xstrdup(txt); |
| |
64 | |
| |
65 | while((c=*t) != '\0') { |
| |
66 | if (c=='=') { |
| |
67 | *t = '\0'; |
| |
68 | value = t+1; |
| |
69 | } else if (c=='&') { |
| |
70 | *t = '\0'; |
| |
71 | (*fn)(txt, value); |
| |
72 | txt = t+1; |
| |
73 | value = NULL; |
| |
74 | } |
| |
75 | t++; |
| |
76 | } |
| |
77 | if (t!=txt) |
| |
78 | (*fn)(txt, value); |
| |
79 | return 0; |
| |
80 | } |
| |
81 | |
| |
82 | void cgit_global_config_cb(const char *name, const char *value) |
56 | void cgit_global_config_cb(const char *name, const char *value) |
83 | { |
57 | { |
84 | if (!strcmp(name, "root")) |
58 | if (!strcmp(name, "root")) |
85 | cgit_root = xstrdup(value); |
59 | cgit_root = xstrdup(value); |
|