File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,12 @@ bool
131
131
fs_is_prefix (std::string_view prefix, std::string_view path)
132
132
{
133
133
// Lexicographically, is prefix a prefix of path.
134
- // Does not normalize, canonicalize, or walk up the directory tree.
135
- // "." or ".." or mix of absolute and relative paths give ambiguous results
136
134
137
135
if (prefix.empty () || path.empty ())
138
136
return false ;
139
137
140
- std::string const pr = fs_drop_slash (prefix);
141
- std::string const p = fs_drop_slash (path);
138
+ std::string const pr = fs_normal (prefix);
139
+ std::string const p = fs_normal (path);
142
140
143
141
if (pr == p)
144
142
return true ;
@@ -159,14 +157,12 @@ bool
159
157
fs_is_subdir (std::string_view subdir, std::string_view dir)
160
158
{
161
159
// Lexicographically, is subdir a subdirectory of dir.
162
- // Does not normalize, canonicalize, or walk up the directory tree.
163
- // "." or ".." give ambiguous results
164
160
165
161
if (subdir.empty () || dir.empty ())
166
162
return false ;
167
163
168
- std::string const s = fs_drop_slash (subdir);
169
- std::string const d = fs_drop_slash (dir);
164
+ std::string const s = fs_normal (subdir);
165
+ std::string const d = fs_normal (dir);
170
166
171
167
if (s == d)
172
168
return false ;
You can’t perform that action at this time.
0 commit comments