Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 47efdb2

Browse files
kbleeskasal
authored andcommitted
Revert "mingw.c: move definition of mingw_getenv down"
This reverts commit 06bc4b7. Signed-off-by: Karsten Blees <[email protected]>
1 parent 1ec9937 commit 47efdb2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

compat/mingw.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int ask_yes_no_if_possible(const char *format, ...)
178178
vsnprintf(question, sizeof(question), format, args);
179179
va_end(args);
180180

181-
if ((retry_hook[0] = mingw_getenv("GIT_ASK_YESNO"))) {
181+
if ((retry_hook[0] = getenv("GIT_ASK_YESNO"))) {
182182
retry_hook[1] = question;
183183
return !run_command_v_opt(retry_hook, 0);
184184
}
@@ -630,6 +630,19 @@ char *mingw_getcwd(char *pointer, int len)
630630
return ret;
631631
}
632632

633+
#undef getenv
634+
char *mingw_getenv(const char *name)
635+
{
636+
char *result = getenv(name);
637+
if (!result && !strcmp(name, "TMPDIR")) {
638+
/* on Windows it is TMP and TEMP */
639+
result = getenv("TMP");
640+
if (!result)
641+
result = getenv("TEMP");
642+
}
643+
return result;
644+
}
645+
633646
/*
634647
* See http://msdn2.microsoft.com/en-us/library/17w5ykft(vs.71).aspx
635648
* (Parsing C++ Command-Line Arguments)
@@ -729,7 +742,7 @@ static const char *parse_interpreter(const char *cmd)
729742
*/
730743
static char **get_path_split(void)
731744
{
732-
char *p, **path, *envpath = mingw_getenv("PATH");
745+
char *p, **path, *envpath = getenv("PATH");
733746
int i, n = 0;
734747

735748
if (!envpath || !*envpath)
@@ -1154,19 +1167,6 @@ char **make_augmented_environ(const char *const *vars)
11541167
return env;
11551168
}
11561169

1157-
#undef getenv
1158-
char *mingw_getenv(const char *name)
1159-
{
1160-
char *result = getenv(name);
1161-
if (!result && !strcmp(name, "TMPDIR")) {
1162-
/* on Windows it is TMP and TEMP */
1163-
result = getenv("TMP");
1164-
if (!result)
1165-
result = getenv("TEMP");
1166-
}
1167-
return result;
1168-
}
1169-
11701170
/*
11711171
* Note, this isn't a complete replacement for getaddrinfo. It assumes
11721172
* that service contains a numerical port, or that it is null. It

0 commit comments

Comments
 (0)