git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix safe_create_leading_directories() for Windows
@ 2014-01-02 17:22 Sebastian Schuberth
  2014-01-02 17:33 ` Johannes Schindelin
  0 siblings, 1 reply; 22+ messages in thread
From: Sebastian Schuberth @ 2014-01-02 17:22 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Johannes Schindelin

See https://github.com/msysgit/git/pull/80.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 sha1_file.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sha1_file.c b/sha1_file.c
index 760dd60..2114c58 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -110,12 +110,15 @@ int safe_create_leading_directories(char *path)
 	char *pos = path + offset_1st_component(path);
 	struct stat st;
 
-	while (pos) {
-		pos = strchr(pos, '/');
-		if (!pos)
-			break;
-		while (*++pos == '/')
-			;
+	while (*pos) {
+		while (!is_dir_sep(*pos)) {
+			++pos;
+			if (!*pos)
+				break;
+		}
+		/* skip consecutive directory separators */
+		while (is_dir_sep(*pos))
+			++pos;
 		if (!*pos)
 			break;
 		*--pos = '\0';
-- 
1.8.4.msysgit.0.1.ge705bba.dirty

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-01-21 20:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-02 17:22 [PATCH] Fix safe_create_leading_directories() for Windows Sebastian Schuberth
2014-01-02 17:33 ` Johannes Schindelin
2014-01-02 18:11   ` Sebastian Schuberth
2014-01-02 18:18     ` John Keeping
2014-01-02 20:37       ` Sebastian Schuberth
2014-01-02 20:46     ` Johannes Schindelin
2014-01-07 15:43       ` Erik Faye-Lund
2014-01-07 17:56         ` Johannes Schindelin
2014-01-07 21:49           ` Sebastian Schuberth
2014-01-02 19:55   ` Junio C Hamano
2014-01-02 20:42     ` Johannes Schindelin
2014-01-02 20:48     ` Sebastian Schuberth
2014-01-02 20:54       ` [PATCH v2] " Sebastian Schuberth
2014-01-02 21:10         ` Johannes Schindelin
2014-01-02 21:24         ` Junio C Hamano
2014-01-02 21:51           ` Junio C Hamano
2014-01-02 22:12             ` Junio C Hamano
2014-01-02 21:08       ` [PATCH] " Junio C Hamano
2014-01-02 21:19         ` Johannes Schindelin
2014-01-19  7:00           ` Sebastian Schuberth
2014-01-19  7:26         ` Sebastian Schuberth
2014-01-21 20:09           ` Junio C Hamano

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).