Skip to content

Commit 09ef14e

Browse files
committed
Fix FilePath resolved (fix #38)
1 parent 8f55be6 commit 09ef14e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/cppfs/source/FilePath.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ std::string FilePath::resolved() const
272272
std::string name;
273273
while (std::getline(ss, name, '/'))
274274
{
275+
// Ignore empty segments such as in "/usr/bin//../bin/bash"
276+
// However, do not ignore a possibly empty segment at the start of a path
277+
if (name.empty() && !parts.empty())
278+
{
279+
continue;
280+
}
281+
275282
parts.push_back(name);
276283
}
277284

0 commit comments

Comments
 (0)