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 <[email protected]>
Cc: Jaben Carsey <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
---
 ShellPkg/Application/Shell/ShellProtocol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index 0e5d954..6f29250 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -2507,10 +2507,14 @@ ShellSearchHandle(
         Status = EfiShellFreeFileList(&ShellInfo);
       }
     }
   }
 
+  if (*FileList == NULL || (*FileList != NULL && 
IsListEmpty(&(*FileList)->Link))) {
+    Status = EFI_NOT_FOUND;
+  }
+
   FreePool(CurrentFilePattern);
   return (Status);
 }
 
 /**
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to