mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 22:54:51 +02:00
MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.."
Replace multiple, consecutive "\" characters prior to other processing involving "\" characters. This fixes an issue where "\\..\\..", "//..//..", and similar input paths are not cleaned properly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jim Dailey <jim_dailey@dell.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@Intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
add1310df5
commit
b08b045ca9
@ -86,6 +86,13 @@ PathCleanUpDirectories(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Replace the "\\" with "\"
|
||||||
|
//
|
||||||
|
while ((TempString = StrStr (Path, L"\\\\")) != NULL) {
|
||||||
|
CopyMem (TempString, TempString + 1, StrSize (TempString + 1));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Remove all the "\.". E.g.: fs0:\abc\.\def\.
|
// Remove all the "\.". E.g.: fs0:\abc\.\def\.
|
||||||
//
|
//
|
||||||
@ -109,13 +116,6 @@ PathCleanUpDirectories(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Replace the "\\" with "\"
|
|
||||||
//
|
|
||||||
while ((TempString = StrStr (Path, L"\\\\")) != NULL) {
|
|
||||||
CopyMem (TempString, TempString + 1, StrSize (TempString + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Path;
|
return Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user