diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-10 18:06:01 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-10 18:06:01 +0000 |
commit | 5f7431d0cf57f68b0f2ad7cb89684c7ec3a4c252 (patch) | |
tree | 2fba8777d43afa4fd3297352f17a3d67d4b42c03 /ShellPkg/Library | |
parent | afb84e42479e7a95e79f7f9ba9bf3cf9d035b05d (diff) | |
download | edk2-5f7431d0cf57f68b0f2ad7cb89684c7ec3a4c252.zip edk2-5f7431d0cf57f68b0f2ad7cb89684c7ec3a4c252.tar.gz edk2-5f7431d0cf57f68b0f2ad7cb89684c7ec3a4c252.tar.bz2 |
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
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 7b7533a..54b6a43 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -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));
@@ -2162,4 +2170,4 @@ ShellPrintEx( FreePool(PostReplaceFormat2);
return (Return);
-}
\ No newline at end of file +}
|