Skip to content

Commit

Permalink
Resolve single dots in MakeAbsolute.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Jan 29, 2024
1 parent 4023122 commit de30a36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/iop/Iop_McServ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ std::string CMcServ::MakeAbsolutePath(const std::string& inputPath)
for(const auto& frag : frags)
{
if(frag.empty()) continue;
if(frag == ".")
{
continue;
}
if(frag == "..")
{
if(newFrags.empty())
Expand Down
3 changes: 3 additions & 0 deletions tools/McServTest/tests/LOTR_ROTK.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<Test Query="icon.sys" CurrentDirectory="../../../BASLUS-20770LOTRROTK" EnvironmentId="1" MaxEntries="1" Result="1">
<Entry Name="icon.sys" />
</Test>
<Test Query="icon.sys" CurrentDirectory="../BASLUS-20770LOTRROTK/././" EnvironmentId="1" MaxEntries="1" Result="1">
<Entry Name="icon.sys" />
</Test>
<Test Query="icon.sys" CurrentDirectory="dummy1/dummy2/../../BASLUS-20770LOTRROTK/" EnvironmentId="1" MaxEntries="1" Result="1">
<Entry Name="icon.sys" />
</Test>
Expand Down

0 comments on commit de30a36

Please sign in to comment.