summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-10 15:05:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-11 09:10:28 (GMT)
commit86e254584bb466aaf1bacbdf4a1ade924c8bdbe9 (patch)
treeacc2e07cff8b12d392e82a927e3471c3499e2afc /compat
parentc1be1cb7ea064bae5ee1cd226aa42b767f2b52c4 (diff)
downloadgit-86e254584bb466aaf1bacbdf4a1ade924c8bdbe9.zip
git-86e254584bb466aaf1bacbdf4a1ade924c8bdbe9.tar.gz
git-86e254584bb466aaf1bacbdf4a1ade924c8bdbe9.tar.bz2
mingw/msvc: use the new-style RUNTIME_PREFIX helper
This change also allows us to stop overriding argv[0] with the absolute path of the executable, allowing us to preserve e.g. the case of the executable's file name. This fixes https://github.com/git-for-windows/git/issues/1496 partially. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index a67872b..6ded1c8 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2221,7 +2221,7 @@ void mingw_startup(void)
die_startup();
/* determine size of argv and environ conversion buffer */
- maxlen = wcslen(_wpgmptr);
+ maxlen = wcslen(wargv[0]);
for (i = 1; i < argc; i++)
maxlen = max(maxlen, wcslen(wargv[i]));
for (i = 0; wenv[i]; i++)
@@ -2241,8 +2241,7 @@ void mingw_startup(void)
buffer = malloc_startup(maxlen);
/* convert command line arguments and environment to UTF-8 */
- __argv[0] = wcstoutfdup_startup(buffer, _wpgmptr, maxlen);
- for (i = 1; i < argc; i++)
+ for (i = 0; i < argc; i++)
__argv[i] = wcstoutfdup_startup(buffer, wargv[i], maxlen);
for (i = 0; wenv[i]; i++)
environ[i] = wcstoutfdup_startup(buffer, wenv[i], maxlen);