fix signed range problems with hex conversions
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index ed1c65e3095fbbbeab88976bbae358a9d76ad937..3d0754cbaa2545c656891febde240911b2335f7d 100644 (file)
--- a/git.c
+++ b/git.c
@@ -66,6 +66,7 @@ static int handle_options(const char*** argv, int* argc)
                        setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
                        (*argv)++;
                        (*argc)--;
+                       handled++;
                } else if (!prefixcmp(cmd, "--git-dir=")) {
                        setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
                } else if (!strcmp(cmd, "--bare")) {
@@ -99,7 +100,7 @@ static int split_cmdline(char *cmdline, const char ***argv)
        int src, dst, count = 0, size = 16;
        char quoted = 0;
 
-       *argv = malloc(sizeof(char*) * size);
+       *argv = xmalloc(sizeof(char*) * size);
 
        /* split alias_string */
        (*argv)[count++] = cmdline;
@@ -224,9 +225,9 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                int option;
        } commands[] = {
                { "add", cmd_add, RUN_SETUP | NOT_BARE },
-               { "annotate", cmd_annotate, USE_PAGER },
+               { "annotate", cmd_annotate, RUN_SETUP | USE_PAGER },
                { "apply", cmd_apply },
-               { "archive", cmd_archive, RUN_SETUP },
+               { "archive", cmd_archive },
                { "blame", cmd_blame, RUN_SETUP },
                { "branch", cmd_branch, RUN_SETUP },
                { "bundle", cmd_bundle },