* [patch] ShellPkg: Fix the incorrect return status in function FindFiles()
@ 2016-08-24 3:12 Dandan Bi
2016-08-24 3:27 ` Ni, Ruiyu
0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2016-08-24 3:12 UTC (permalink / raw)
To: edk2-devel; +Cc: Ruiyu Ni, Jaben Carsey
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] ShellPkg: Fix the incorrect return status in function FindFiles()
2016-08-24 3:12 [patch] ShellPkg: Fix the incorrect return status in function FindFiles() Dandan Bi
@ 2016-08-24 3:27 ` Ni, Ruiyu
0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ruiyu @ 2016-08-24 3:27 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Carsey, Jaben
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, August 24, 2016 11:13 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [patch] ShellPkg: Fix the incorrect return status in function FindFiles()
>
> 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>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-24 3:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-24 3:12 [patch] ShellPkg: Fix the incorrect return status in function FindFiles() Dandan Bi
2016-08-24 3:27 ` Ni, Ruiyu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox