|
diff --git a/shared.c b/shared.c index b6d2fa1..c7cd8a5 100644 --- a/ shared.c+++ b/ shared.c |
|
@@ -46,33 +46,34 @@ int cgit_query_has_sha1 = 0; |
46 | char *cgit_querystring = NULL; |
46 | char *cgit_querystring = NULL; |
47 | char *cgit_query_repo = NULL; |
47 | char *cgit_query_repo = NULL; |
48 | char *cgit_query_page = NULL; |
48 | char *cgit_query_page = NULL; |
49 | char *cgit_query_head = NULL; |
49 | char *cgit_query_head = NULL; |
50 | char *cgit_query_search = NULL; |
50 | char *cgit_query_search = NULL; |
51 | char *cgit_query_sha1 = NULL; |
51 | char *cgit_query_sha1 = NULL; |
52 | char *cgit_query_sha2 = NULL; |
52 | char *cgit_query_sha2 = NULL; |
53 | char *cgit_query_path = NULL; |
53 | char *cgit_query_path = NULL; |
54 | char *cgit_query_name = NULL; |
54 | char *cgit_query_name = NULL; |
55 | int cgit_query_ofs = 0; |
55 | int cgit_query_ofs = 0; |
56 | |
56 | |
57 | int htmlfd = 0; |
57 | int htmlfd = 0; |
58 | |
58 | |
59 | |
59 | |
60 | int cgit_get_cmd_index(const char *cmd) |
60 | int cgit_get_cmd_index(const char *cmd) |
61 | { |
61 | { |
62 | static char *cmds[] = {"log", "commit", "diff", "tree", "view", "blob", "snapshot", NULL}; |
62 | static char *cmds[] = {"log", "commit", "diff", "tree", "blob", |
| |
63 | "snapshot", NULL}; |
63 | int i; |
64 | int i; |
64 | |
65 | |
65 | for(i = 0; cmds[i]; i++) |
66 | for(i = 0; cmds[i]; i++) |
66 | if (!strcmp(cmd, cmds[i])) |
67 | if (!strcmp(cmd, cmds[i])) |
67 | return i + 1; |
68 | return i + 1; |
68 | return 0; |
69 | return 0; |
69 | } |
70 | } |
70 | |
71 | |
71 | int chk_zero(int result, char *msg) |
72 | int chk_zero(int result, char *msg) |
72 | { |
73 | { |
73 | if (result != 0) |
74 | if (result != 0) |
74 | die("%s: %s", msg, strerror(errno)); |
75 | die("%s: %s", msg, strerror(errno)); |
75 | return result; |
76 | return result; |
76 | } |
77 | } |
77 | |
78 | |
78 | int chk_positive(int result, char *msg) |
79 | int chk_positive(int result, char *msg) |
|