mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 06:15:02 +00:00
COM0 is a valid path, although Windows Explorer does not allow to create this
This commit is contained in:
parent
629417bd10
commit
6fd00266a8
@ -1254,7 +1254,7 @@ GIT_INLINE(bool) verify_dospath(
|
||||
if (len < last || git__strncasecmp(component, dospath, 3) != 0)
|
||||
return true;
|
||||
|
||||
if (trailing_num && !git__isdigit(component[3]))
|
||||
if (trailing_num && (component[3] < '1' || component[3] > '9'))
|
||||
return true;
|
||||
|
||||
return (len > last &&
|
||||
|
@ -233,6 +233,8 @@ void test_path_core__isvalid_dos_paths_withnum(void)
|
||||
cl_assert_equal_b(false, git_path_isvalid(NULL, "com1.asdf\\zippy", GIT_PATH_REJECT_DOS_PATHS));
|
||||
cl_assert_equal_b(false, git_path_isvalid(NULL, "com1:asdf\\foobar", GIT_PATH_REJECT_DOS_PATHS));
|
||||
|
||||
cl_assert_equal_b(true, git_path_isvalid(NULL, "com0", 0));
|
||||
cl_assert_equal_b(true, git_path_isvalid(NULL, "com0", GIT_PATH_REJECT_DOS_PATHS));
|
||||
cl_assert_equal_b(true, git_path_isvalid(NULL, "com10", 0));
|
||||
cl_assert_equal_b(true, git_path_isvalid(NULL, "com10", GIT_PATH_REJECT_DOS_PATHS));
|
||||
cl_assert_equal_b(true, git_path_isvalid(NULL, "comn", GIT_PATH_REJECT_DOS_PATHS));
|
||||
|
Loading…
Reference in New Issue
Block a user