@@ -178,7 +178,7 @@ static int ask_yes_no_if_possible(const char *format, ...)
178
178
vsnprintf (question , sizeof (question ), format , args );
179
179
va_end (args );
180
180
181
- if ((retry_hook [0 ] = mingw_getenv ("GIT_ASK_YESNO" ))) {
181
+ if ((retry_hook [0 ] = getenv ("GIT_ASK_YESNO" ))) {
182
182
retry_hook [1 ] = question ;
183
183
return !run_command_v_opt (retry_hook , 0 );
184
184
}
@@ -630,6 +630,19 @@ char *mingw_getcwd(char *pointer, int len)
630
630
return ret ;
631
631
}
632
632
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
+
633
646
/*
634
647
* See http://msdn2.microsoft.com/en-us/library/17w5ykft(vs.71).aspx
635
648
* (Parsing C++ Command-Line Arguments)
@@ -729,7 +742,7 @@ static const char *parse_interpreter(const char *cmd)
729
742
*/
730
743
static char * * get_path_split (void )
731
744
{
732
- char * p , * * path , * envpath = mingw_getenv ("PATH" );
745
+ char * p , * * path , * envpath = getenv ("PATH" );
733
746
int i , n = 0 ;
734
747
735
748
if (!envpath || !* envpath )
@@ -1154,19 +1167,6 @@ char **make_augmented_environ(const char *const *vars)
1154
1167
return env ;
1155
1168
}
1156
1169
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
-
1170
1170
/*
1171
1171
* Note, this isn't a complete replacement for getaddrinfo. It assumes
1172
1172
* that service contains a numerical port, or that it is null. It
0 commit comments