diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-10 12:45:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-10 12:45:35 -0700 |
commit | 7945c7fad05da2ac7f6f1f89202799993a591eac (patch) | |
tree | 1763e5367ed6d8dd06b6eb1998b32edd09b44043 | |
parent | 926b1ec63ee045503f609e88ca445b94c06bd5d7 (diff) | |
parent | fdec2eb8ebbf995a77e2ab9971565c792b52944a (diff) | |
download | git-7945c7fad05da2ac7f6f1f89202799993a591eac.tar.gz |
Merge branch 'maint'
* maint:
test-subprocess: fix segfault without arguments
submodule: fix prototype of gitmodules_config
-rw-r--r-- | submodule.h | 2 | ||||
-rw-r--r-- | test-subprocess.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/submodule.h b/submodule.h index 80e04f3c8c..9c5e5c0c30 100644 --- a/submodule.h +++ b/submodule.h @@ -13,7 +13,7 @@ enum { void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt, const char *path); int submodule_config(const char *var, const char *value, void *cb); -void gitmodules_config(); +void gitmodules_config(void); int parse_submodule_config_option(const char *var, const char *value); void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *); int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg); diff --git a/test-subprocess.c b/test-subprocess.c index 8926bc52a9..f2d4c0d22b 100644 --- a/test-subprocess.c +++ b/test-subprocess.c @@ -1,7 +1,7 @@ #include "cache.h" #include "run-command.h" -int main(int argc, char **argv) +int main(int argc, const char **argv) { struct child_process cp; int nogit = 0; @@ -9,12 +9,12 @@ int main(int argc, char **argv) setup_git_directory_gently(&nogit); if (nogit) die("No git repo found"); - if (!strcmp(argv[1], "--setup-work-tree")) { + if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) { setup_work_tree(); argv++; } memset(&cp, 0, sizeof(cp)); cp.git_cmd = 1; - cp.argv = (const char **)argv+1; + cp.argv = argv + 1; return run_command(&cp); } |