diff --git a/MdePkg/Library/BaseLib/FilePaths.c b/MdePkg/Library/BaseLib/FilePaths.c index b7ff480bb9..c72ef726ba 100644 --- a/MdePkg/Library/BaseLib/FilePaths.c +++ b/MdePkg/Library/BaseLib/FilePaths.c @@ -1,7 +1,7 @@ /** @file Defines file-path manipulation functions. - Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -96,7 +96,9 @@ PathCleanUpDirectories( } if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) { *TempString = CHAR_NULL; - PathRemoveLastItem(Path); + if (!PathRemoveLastItem(Path)) { + *TempString = L'\\'; + } } // // Fix up the .