]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fix build breaks. and allow for new lists to be created.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Jul 2009 18:06:01 +0000 (18:06 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Jul 2009 18:06:01 +0000 (18:06 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8885 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellLib/UefiShellLib.c

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