Commit 3bdf09c7 authored by Junio C Hamano's avatar Junio C Hamano

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: default avatarJunio C Hamano <[email protected]>
parent 56948cb6
......@@ -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++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment