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
13
read-cache.c
13
read-cache.c
@ -784,16 +784,9 @@ 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;
|
return 0;
|
||||||
case '/': case '\0':
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
if (verify_dotfile(path))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
c = *path++;
|
c = *path++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user