summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56948cb)
raw | patch | inline | side by side (parent: 56948cb)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 7 Jun 2011 03:49:06 +0000 (20:49 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 7 Jun 2011 19:22:51 +0000 (12:22 -0700) |
We simply want to say "At a directory boundary, be careful with a name
that begins with a dot, forbid a name that ends with the boundary
character or has duplicated bounadry characters".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
that begins with a dot, forbid a name that ends with the boundary
character or has duplicated bounadry characters".
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 31cf0b503adb9c9b436a74df6ab11992d863a057..3593291f7c1975738063618612c5af98d5cf2330 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
if (is_dir_sep(c)) {
inside:
c = *path++;
- switch (c) {
- default:
- continue;
- case '/': case '\0':
- break;
- case '.':
- if (verify_dotfile(path))
- continue;
- }
- return 0;
+ if ((c == '.' && !verify_dotfile(path)) ||
+ is_dir_sep(c) || c == '\0')
+ return 0;
}
c = *path++;
}