Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
verify_path(): simplify check at the directory boundary
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>
read-cache.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
56948cb
)
diff --git
a/read-cache.c
b/read-cache.c
index 31cf0b503adb9c9b436a74df6ab11992d863a057..3593291f7c1975738063618612c5af98d5cf2330 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-784,16
+784,9
@@
int verify_path(const char *path)
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++;
}