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:
11
read-cache.c
11
read-cache.c
@ -784,15 +784,8 @@ int verify_path(const char *path)
|
|||||||
if (is_dir_sep(c)) {
|
if (is_dir_sep(c)) {
|
||||||
inside:
|
inside:
|
||||||
c = *path++;
|
c = *path++;
|
||||||
switch (c) {
|
if ((c == '.' && !verify_dotfile(path)) ||
|
||||||
default:
|
is_dir_sep(c) || c == '\0')
|
||||||
continue;
|
|
||||||
case '/': case '\0':
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
if (verify_dotfile(path))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
c = *path++;
|
c = *path++;
|
||||||
|
Reference in New Issue
Block a user