summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2016-04-02 19:03:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-05 01:03:02 (GMT)
commit8e9b20804a9900d4560e9ace4bb8c5d048a2097e (patch)
tree689892e0927299f6fced342cf8098931c3d91742 /compat
parent8257d3b458f0b64516f4aee66a9b2b2df30744e1 (diff)
downloadgit-8e9b20804a9900d4560e9ace4bb8c5d048a2097e.zip
git-8e9b20804a9900d4560e9ace4bb8c5d048a2097e.tar.gz
git-8e9b20804a9900d4560e9ace4bb8c5d048a2097e.tar.bz2
Windows: shorten code by re-using convert_slashes()
Make a few more spots more readable by using the recently introduced, Windows-specific helper. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 54c82ec..0413d5c 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) */