mirror of
https://github.com/git/git.git
synced 2026-02-06 07:54:56 +00:00
Revert "mingw.c: move definition of mingw_getenv down"
This reverts commit 06bc4b796a.
Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
committed by
Stepan Kasal
parent
1ec9937945
commit
47efdb2e8f
@@ -178,7 +178,7 @@ static int ask_yes_no_if_possible(const char *format, ...)
|
||||
vsnprintf(question, sizeof(question), format, args);
|
||||
va_end(args);
|
||||
|
||||
if ((retry_hook[0] = mingw_getenv("GIT_ASK_YESNO"))) {
|
||||
if ((retry_hook[0] = getenv("GIT_ASK_YESNO"))) {
|
||||
retry_hook[1] = question;
|
||||
return !run_command_v_opt(retry_hook, 0);
|
||||
}
|
||||
@@ -630,6 +630,19 @@ char *mingw_getcwd(char *pointer, int len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#undef getenv
|
||||
char *mingw_getenv(const char *name)
|
||||
{
|
||||
char *result = getenv(name);
|
||||
if (!result && !strcmp(name, "TMPDIR")) {
|
||||
/* on Windows it is TMP and TEMP */
|
||||
result = getenv("TMP");
|
||||
if (!result)
|
||||
result = getenv("TEMP");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* See http://msdn2.microsoft.com/en-us/library/17w5ykft(vs.71).aspx
|
||||
* (Parsing C++ Command-Line Arguments)
|
||||
@@ -729,7 +742,7 @@ static const char *parse_interpreter(const char *cmd)
|
||||
*/
|
||||
static char **get_path_split(void)
|
||||
{
|
||||
char *p, **path, *envpath = mingw_getenv("PATH");
|
||||
char *p, **path, *envpath = getenv("PATH");
|
||||
int i, n = 0;
|
||||
|
||||
if (!envpath || !*envpath)
|
||||
@@ -1154,19 +1167,6 @@ char **make_augmented_environ(const char *const *vars)
|
||||
return env;
|
||||
}
|
||||
|
||||
#undef getenv
|
||||
char *mingw_getenv(const char *name)
|
||||
{
|
||||
char *result = getenv(name);
|
||||
if (!result && !strcmp(name, "TMPDIR")) {
|
||||
/* on Windows it is TMP and TEMP */
|
||||
result = getenv("TMP");
|
||||
if (!result)
|
||||
result = getenv("TEMP");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note, this isn't a complete replacement for getaddrinfo. It assumes
|
||||
* that service contains a numerical port, or that it is null. It
|
||||
|
||||
Reference in New Issue
Block a user