]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix the incorrect return status in function FindFiles()
authorDandan Bi <dandan.bi@intel.com>
Tue, 23 Aug 2016 02:29:08 +0000 (10:29 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 1 Sep 2016 08:38:07 +0000 (16:38 +0800)
According to the latest shell spec, in function FindFiles(),
when no files were found, it should return EFI_NOT_FOUND.
But current codes don't follow the spec.
This patch is to fix this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
ShellPkg/Application/Shell/ShellProtocol.c

index 0e5d954e45fc9c40be1f5be9bdd63fd156ed82c9..6f292507a9b63a753d1c77cd4cecb4ff6b26aa6d 100644 (file)
@@ -2509,6 +2509,10 @@ ShellSearchHandle(
     }\r
   }\r
 \r
+  if (*FileList == NULL || (*FileList != NULL && IsListEmpty(&(*FileList)->Link))) {\r
+    Status = EFI_NOT_FOUND;\r
+  }\r
+\r
   FreePool(CurrentFilePattern);\r
   return (Status);\r
 }\r