\r
/**\r
Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the\r
- directory 'stack'.\r
+ directory 'stack'. If the file is a directory, then append the '\' char at the \r
+ end of name string. If it's not a directory, then the last '\' should not be \r
+ added.\r
\r
@param[in] Handle Handle to the Directory or File to create path to.\r
@param[out] FullFileName Pointer to pointer to generated full file name. It\r
\r
/**\r
Function to get a full filename given a EFI_FILE_HANDLE somewhere lower on the\r
- directory 'stack'.\r
+ directory 'stack'. If the file is a directory, then append the '\' char at the \r
+ end of name string. If it's not a directory, then the last '\' should not be \r
+ added.\r
\r
if Handle is NULL, return EFI_INVALID_PARAMETER\r
\r
*FullFileName = StrnCatGrowLeft(FullFileName, &Size, L"\\", 0);\r
}\r
\r
+ if (*FullFileName != NULL && \r
+ (*FullFileName)[StrLen(*FullFileName) - 1] == L'\\' && \r
+ StrLen(*FullFileName) > 1 &&\r
+ FileHandleIsDirectory(Handle) == EFI_NOT_FOUND\r
+ ) {\r
+ (*FullFileName)[StrLen(*FullFileName) - 1] = CHAR_NULL;\r
+ }\r
+\r
if (CurrentHandle != NULL) {\r
CurrentHandle->Close (CurrentHandle);\r
}\r