[PATCH] Fix path normalization for SMB shares

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]