git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix path normalization for SMB shares

From
Orgad Shaneh <orgads@gmail.com>
Date
Sep 5, 2012, 11:28 UTC
Message-ID
<1346844507-22998-1-git-send-email-orgads@gmail.com>

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
Message 1 of 1 in “Fix path normalization for SMB shares”
  1. Fix path normalization for SMB sharesOrgad Shaneh, Sep 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.