]> git.ipfire.org Git - thirdparty/git.git/commitdiff
msvc: mark a variable as non-const
authorJeff Hostetler <jeffhost@microsoft.com>
Wed, 19 Jun 2019 21:06:02 +0000 (14:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2019 21:03:05 +0000 (14:03 -0700)
VS2015 complains when using a const pointer in memcpy()/free().

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c

index 0d8713e515c869c763dbde7008b4134f16c1c3d8..d14d33308d6d3a0d336d235b66329f95d9d0b30e 100644 (file)
@@ -1553,7 +1553,10 @@ static int try_shell_exec(const char *cmd, char *const *argv)
        if (prog) {
                int exec_id;
                int argc = 0;
-               const char **argv2;
+#ifndef _MSC_VER
+               const
+#endif
+               char **argv2;
                while (argv[argc]) argc++;
                ALLOC_ARRAY(argv2, argc + 1);
                argv2[0] = (char *)cmd; /* full path to the script file */