Add absolute path for UNC

This commit is contained in:
Reckordp
2020-03-07 15:50:14 +07:00
parent f319c5fb26
commit 5a4b9fd877
+4 -2
View File
@@ -284,8 +284,10 @@ mrb_file_is_absolute_path(const char *path)
{
#ifdef _WIN32
#define IS_PATHSEP(x) (x == '/' || x == '\\')
if (strlen(path) < 3) return 0;
return (isalpha(path[0]) && path[1] == ':' && IS_PATHSEP(path[2]));
if (isalpha(path[0]))
return (strlen(path) > 2 && path[1] == ':' && IS_PATHSEP(path[2]));
else
return (IS_PATHSEP(path[0]) && IS_PATHSEP(path[1]));
#undef IS_PATHSEP
#else
return (path[0] == '/');