File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -90,15 +90,12 @@ fs_drop_trailing_slash(std::string_view path)
90
90
// drop trailing "/" and "\" from the path
91
91
// but not if it is the root name
92
92
93
- if (path.empty ())
94
- return {};
95
-
96
93
std::string p (path);
97
94
98
95
while (p.length () > 1 && (p.back () == ' /' || (fs_is_windows () && p.back () == ' \\ ' )))
99
96
p.pop_back ();
100
97
101
- if (fs_is_windows () && p == fs_root_name (path))
98
+ if (fs_is_windows () && !p. empty () && p == fs_root_name (path))
102
99
p.push_back (' /' );
103
100
104
101
return p;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ std::string fs_parent(std::string_view path)
53
53
return " ." ;
54
54
55
55
// need this for <filesystem> or _splitpath_s to make x: x:/
56
- if (fs_is_windows () && !p. empty () && p == fs_root_name (p))
56
+ if (fs_is_windows () && p == fs_root_name (p))
57
57
p.push_back (' /' );
58
58
59
59
return p;
You can’t perform that action at this time.
0 commit comments