File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ fs_drop_slash(std::string_view in)
118
118
119
119
if (fs_is_windows ()){
120
120
// Extended-length or device path
121
- if (in. length () >= 4 && fs_win32_is_ext_path (in)){
121
+ if (fs_win32_is_ext_path (in)){
122
122
i = 4 ;
123
123
#if defined(_WIN32)
124
124
} else if (PathIsUNCA (in.data ())){
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ bool fs_is_absolute(std::string_view path)
69
69
return false ;
70
70
71
71
// Extended-length or device path
72
- if (path. length () >= 4 && fs_win32_is_ext_path (path))
72
+ if (fs_win32_is_ext_path (path))
73
73
return true ;
74
74
#if defined(_WIN32)
75
75
if (PathIsUNCA (path.data ()))
@@ -109,8 +109,15 @@ std::string fs_root(std::string_view path)
109
109
if (std::string r = fs_root_name (path);
110
110
r.empty ())
111
111
return fs_slash_first (path) ? " /" : " " ;
112
- else
113
- return (fs_is_windows () && r == path) ? r : r + " /" ;
112
+ else if (fs_is_windows ()) {
113
+ if (path.length () >= 3 && (path[2 ] == ' /' || path[2 ] == ' \\ ' )){
114
+ return r + path[2 ];
115
+ }
116
+
117
+ return r;
118
+ } else
119
+ return " /" ;
120
+
114
121
#endif
115
122
}
116
123
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ bool fs_win32_is_symlink(std::string_view path)
184
184
bool
185
185
fs_win32_is_ext_path (std::string_view path)
186
186
{
187
- return path.substr (0 , 4 ) == R"( \\?\)" || path.substr (0 , 4 ) == R"( \\.\)" ;
187
+ return path.length () >= 4 && (path. substr (0 , 4 ) == R"( \\?\)" || path.substr (0 , 4 ) == R"( \\.\)" ) ;
188
188
}
189
189
190
190
You can’t perform that action at this time.
0 commit comments