diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-13 14:12:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-13 14:12:34 -0700 |
commit | dd27384c36223dd2ef8f31d0edb5cb6d14a4f3f9 (patch) | |
tree | e9a504428672d3af01ee18a4559b440195814da8 /compat | |
parent | Merge branch 'cc/apply' (diff) | |
parent | Windows: shorten code by re-using convert_slashes() (diff) | |
download | tgif-dd27384c36223dd2ef8f31d0edb5cb6d14a4f3f9.tar.xz |
Merge branch 'js/mingw-tests-2.8'
Code clean-up.
* js/mingw-tests-2.8:
Windows: shorten code by re-using convert_slashes()
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 54c82ecf20..0413d5c3cd 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -763,15 +763,12 @@ struct tm *localtime_r(const time_t *timep, struct tm *result) char *mingw_getcwd(char *pointer, int len) { - int i; wchar_t wpointer[MAX_PATH]; if (!_wgetcwd(wpointer, ARRAY_SIZE(wpointer))) return NULL; if (xwcstoutf(pointer, wpointer, len) < 0) return NULL; - for (i = 0; pointer[i]; i++) - if (pointer[i] == '\\') - pointer[i] = '/'; + convert_slashes(pointer); return pointer; } @@ -2112,9 +2109,7 @@ static void setup_windows_environment() * executable (by not mistaking the dir separators * for escape characters). */ - for (; *tmp; tmp++) - if (*tmp == '\\') - *tmp = '/'; + convert_slashes(tmp); } /* simulate TERM to enable auto-color (see color.c) */ |