summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3bdf09c)
raw | patch | inline | side by side (parent: 3bdf09c)
author | Theo Niessink <theo@taletn.com> | |
Wed, 8 Jun 2011 12:04:41 +0000 (14:04 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 8 Jun 2011 23:34:38 +0000 (16:34 -0700) |
verify_dotfile() currently assumes that the path seperator is '/', but on
Windows it can also be '\\', so use is_dir_sep() instead.
Signed-off-by: Theo Niessink <theo@taletn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Windows it can also be '\\', so use is_dir_sep() instead.
Signed-off-by: Theo Niessink <theo@taletn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index 3593291f7c1975738063618612c5af98d5cf2330..e7c9684218d04830ceda15035d3d8701140f575b 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
* has already been discarded, we now test
* the rest.
*/
- switch (*rest) {
+
/* "." is not allowed */
- case '\0': case '/':
+ if (*rest == '\0' || is_dir_sep(*rest))
return 0;
+ switch (*rest) {
/*
* ".git" followed by NUL or slash is bad. This
* shares the path end test with the ".." case.
rest += 2;
/* fallthrough */
case '.':
- if (rest[1] == '\0' || rest[1] == '/')
+ if (rest[1] == '\0' || is_dir_sep(rest[1]))
return 0;
}
return 1;