summaryrefslogtreecommitdiffabout
path: root/shared.c
Unidiff
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/shared.c b/shared.c
index c58a2ff..6b5cfc2 100644
--- a/shared.c
+++ b/shared.c
@@ -23,16 +23,17 @@ char *cgit_repo_owner = NULL;
23int cgit_query_has_symref = 0; 23int cgit_query_has_symref = 0;
24int cgit_query_has_sha1 = 0; 24int cgit_query_has_sha1 = 0;
25 25
26char *cgit_querystring = NULL; 26char *cgit_querystring = NULL;
27char *cgit_query_repo = NULL; 27char *cgit_query_repo = NULL;
28char *cgit_query_page = NULL; 28char *cgit_query_page = NULL;
29char *cgit_query_head = NULL; 29char *cgit_query_head = NULL;
30char *cgit_query_sha1 = NULL; 30char *cgit_query_sha1 = NULL;
31int cgit_query_ofs = 0;
31 32
32int htmlfd = 0; 33int htmlfd = 0;
33 34
34void cgit_global_config_cb(const char *name, const char *value) 35void cgit_global_config_cb(const char *name, const char *value)
35{ 36{
36 if (!strcmp(name, "root")) 37 if (!strcmp(name, "root"))
37 cgit_root = xstrdup(value); 38 cgit_root = xstrdup(value);
38 else if (!strcmp(name, "root-title")) 39 else if (!strcmp(name, "root-title"))
@@ -54,21 +55,23 @@ void cgit_repo_config_cb(const char *name, const char *value)
54 else if (!strcmp(name, "desc")) 55 else if (!strcmp(name, "desc"))
55 cgit_repo_desc = xstrdup(value); 56 cgit_repo_desc = xstrdup(value);
56 else if (!strcmp(name, "owner")) 57 else if (!strcmp(name, "owner"))
57 cgit_repo_owner = xstrdup(value); 58 cgit_repo_owner = xstrdup(value);
58} 59}
59 60
60void cgit_querystring_cb(const char *name, const char *value) 61void cgit_querystring_cb(const char *name, const char *value)
61{ 62{
62 if (!strcmp(name,"r")) 63 if (!strcmp(name,"r")) {
63 cgit_query_repo = xstrdup(value); 64 cgit_query_repo = xstrdup(value);
64 else if (!strcmp(name, "p")) 65 } else if (!strcmp(name, "p")) {
65 cgit_query_page = xstrdup(value); 66 cgit_query_page = xstrdup(value);
66 else if (!strcmp(name, "h")) { 67 } else if (!strcmp(name, "h")) {
67 cgit_query_head = xstrdup(value); 68 cgit_query_head = xstrdup(value);
68 cgit_query_has_symref = 1; 69 cgit_query_has_symref = 1;
69 } else if (!strcmp(name, "id")) { 70 } else if (!strcmp(name, "id")) {
70 cgit_query_sha1 = xstrdup(value); 71 cgit_query_sha1 = xstrdup(value);
71 cgit_query_has_sha1 = 1; 72 cgit_query_has_sha1 = 1;
73 } else if (!strcmp(name, "ofs")) {
74 cgit_query_ofs = atoi(value);
72 } 75 }
73} 76}
74 77