From 8e9b20804a9900d4560e9ace4bb8c5d048a2097e Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 2 Apr 2016 21:03:14 +0200 Subject: 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 Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- abspath.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'abspath.c') diff --git a/abspath.c b/abspath.c index 5edb4e7816..2825de8591 100644 --- a/abspath.c +++ b/abspath.c @@ -167,7 +167,6 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg) strbuf_add(&path, pfx, pfx_len); strbuf_addstr(&path, arg); #else - char *p; /* don't add prefix to absolute paths, but still replace '\' by '/' */ strbuf_reset(&path); if (is_absolute_path(arg)) @@ -175,9 +174,7 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg) else if (pfx_len) strbuf_add(&path, pfx, pfx_len); strbuf_addstr(&path, arg); - for (p = path.buf + pfx_len; *p; p++) - if (*p == '\\') - *p = '/'; + convert_slashes(path.buf + pfx_len); #endif return path.buf; } -- cgit v1.2.3