fix build breaks. and allow for new lists to be created.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8885 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2009-07-10 18:06:01 +00:00
parent afb84e4247
commit 5f7431d0cf
1 changed files with 10 additions and 2 deletions

View File

@ -1302,7 +1302,8 @@ InternalShellConvertFileListType (
and will process '?' and '*' as such. the list must be freed with a call to
ShellCloseFileMetaArg().
If you are NOT appending to an existing list *ListHead must be NULL.
If you are NOT appending to an existing list *ListHead must be NULL. If
*ListHead is NULL then it must be callee freed.
@param Arg pointer to path string
@param OpenMode mode to open files with
@ -1337,6 +1338,13 @@ ShellOpenFileMetaArg (
// Check for UEFI Shell 2.0 protocols
//
if (mEfiShellProtocol != NULL) {
if (*ListHead == NULL) {
*ListHead = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));
if (*ListHead == NULL) {
return (EFI_OUT_OF_RESOURCES);
}
InitializeListHead(&((*ListHead)->Link));
}
return (mEfiShellProtocol->OpenFileList(Arg,
OpenMode,
ListHead));