From: Jeff King Date: Thu, 23 Jan 2014 01:28:30 +0000 (-0500) Subject: repack: make parsed string options const-correct X-Git-Tag: v1.9-rc1~5^2~1 X-Git-Url: http://git.scripts.mit.edu/?a=commitdiff_plain;h=aa8bd519dbf044f4b54a365c9c80c6eb9a1ee2ea;p=git.git repack: make parsed string options const-correct When we use OPT_STRING to parse an option, we get back a pointer into the argv array, which should be "const char *". The compiler doesn't notice because it gets passed through a "void *" in the option struct. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/builtin/repack.c b/builtin/repack.c index 512a53afd8..3dbb0ed199 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -129,7 +129,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) /* variables to be filled by option parsing */ int pack_everything = 0; int delete_redundant = 0; - char *unpack_unreachable = NULL; + const char *unpack_unreachable = NULL; int window = 0, window_memory = 0; int depth = 0; int max_pack_size = 0;