verify_path(): simplify check at the directory boundary
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>
This commit is contained in:
parent
56948cb6aa
commit
3bdf09c7f5
11
read-cache.c
11
read-cache.c
@ -784,15 +784,8 @@ 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;
|
||||
}
|
||||
if ((c == '.' && !verify_dotfile(path)) ||
|
||||
is_dir_sep(c) || c == '\0')
|
||||
return 0;
|
||||
}
|
||||
c = *path++;
|
||||
|
Loading…
Reference in New Issue
Block a user