Browse Source

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>
maint
Johannes Schindelin 7 years ago committed by Junio C Hamano
parent
commit
86e254584b
  1. 5
      compat/mingw.c
  2. 2
      config.mak.uname

5
compat/mingw.c

@ -2221,7 +2221,7 @@ void mingw_startup(void) @@ -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) @@ -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);

2
config.mak.uname

@ -357,6 +357,7 @@ ifeq ($(uname_S),Windows) @@ -357,6 +357,7 @@ ifeq ($(uname_S),Windows)
SNPRINTF_RETURNS_BOGUS = YesPlease
NO_SVN_TESTS = YesPlease
RUNTIME_PREFIX = YesPlease
HAVE_WPGMPTR = YesWeDo
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
NO_NSEC = YesPlease
USE_WIN32_MMAP = YesPlease
@ -506,6 +507,7 @@ ifneq (,$(findstring MINGW,$(uname_S))) @@ -506,6 +507,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_SVN_TESTS = YesPlease
NO_PERL_MAKEMAKER = YesPlease
RUNTIME_PREFIX = YesPlease
HAVE_WPGMPTR = YesWeDo
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
NO_NSEC = YesPlease
USE_WIN32_MMAP = YesPlease

Loading…
Cancel
Save