git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix path normalization for SMB shares
@ 2012-09-05 11:28 Orgad Shaneh
  0 siblings, 0 replies; only message in thread
From: Orgad Shaneh @ 2012-09-05 11:28 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh

SMB shared are accessed using //server/share/directory...
notation.

normalize_path_copy used to leave only a single slash, which
invalidated the path.

Fix suggested by Nguyen Thai Ngoc Duy

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 path.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/path.c b/path.c
index 66acd24..6cd9c0b 100644
--- a/path.c
+++ b/path.c
@@ -503,6 +503,12 @@ int normalize_path_copy(char *dst, const char *src)
 		*dst++ = *src++;
 		*dst++ = *src++;
 	}
+#ifdef WIN32
+	else if (is_dir_sep(src[0]) && is_dir_sep(src[1])) {
+		*dst++ = '/';
+		src++;
+	}
+#endif
 	dst0 = dst;
 
 	if (is_dir_sep(*src)) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-05 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05 11:28 [PATCH] Fix path normalization for SMB shares Orgad Shaneh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).