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>
}\r
}\r
\r
+ //\r
+ // Replace the "\\" with "\"\r
+ //\r
+ while ((TempString = StrStr (Path, L"\\\\")) != NULL) {\r
+ CopyMem (TempString, TempString + 1, StrSize (TempString + 1));\r
+ }\r
+\r
//\r
// Remove all the "\.". E.g.: fs0:\abc\.\def\.\r
//\r
}\r
}\r
\r
- //\r
- // Replace the "\\" with "\"\r
- //\r
- while ((TempString = StrStr (Path, L"\\\\")) != NULL) {\r
- CopyMem (TempString, TempString + 1, StrSize (TempString + 1));\r
- }\r
-\r
return Path;\r
}\r
\r