-rw-r--r-- | shared.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -46,2 +46,3 @@ char *cgit_query_sha2 = NULL; char *cgit_query_path = NULL; +char *cgit_query_name = NULL; int cgit_query_ofs = 0; @@ -50,2 +51,16 @@ int htmlfd = 0; +int chk_zero(int result, char *msg) +{ + if (result != 0) + die("%s: %s", msg, strerror(errno)); + return result; +} + +int chk_positive(int result, char *msg) +{ + if (result <= 0) + die("%s: %s", msg, strerror(errno)); + return result; +} + struct repoinfo *add_repo(const char *url) @@ -142,2 +157,4 @@ void cgit_querystring_cb(const char *name, const char *value) cgit_query_path = xstrdup(value); + } else if (!strcmp(name, "name")) { + cgit_query_name = xstrdup(value); } |