diff mbox series

[v2,1/5] eficonfig: fix going one directory up issue

Message ID 20221128124509.6939-2-masahisa.kojima@linaro.org
State Superseded
Headers show
Series miscellaneous fixes of eficonfig | expand

Commit Message

Masahisa Kojima Nov. 28, 2022, 12:45 p.m. UTC
The directory name in eficonfig menu entry contains the
'\' separator. strcmp() argument ".." is wrong and one directory
up handling does not work correctly. strcmp() argument must
include '\' separator.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
---
No change since v1

 cmd/eficonfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilias Apalodimas Nov. 29, 2022, 7:14 a.m. UTC | #1
On Mon, Nov 28, 2022 at 09:45:05PM +0900, Masahisa Kojima wrote:
> The directory name in eficonfig menu entry contains the
> '\' separator. strcmp() argument ".." is wrong and one directory
> up handling does not work correctly. strcmp() argument must
> include '\' separator.
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
> No change since v1
> 
>  cmd/eficonfig.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
> index 97d35597a2..5529edc85e 100644
> --- a/cmd/eficonfig.c
> +++ b/cmd/eficonfig.c
> @@ -488,7 +488,7 @@ static efi_status_t eficonfig_file_selected(void *data)
>  	if (!info)
>  		return EFI_INVALID_PARAMETER;
>  
> -	if (!strcmp(info->file_name, "..")) {
> +	if (!strcmp(info->file_name, "..\\")) {
>  		struct eficonfig_filepath_info *iter;
>  		struct list_head *pos, *n;
>  		int is_last;
> -- 
> 2.17.1
> 

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index 97d35597a2..5529edc85e 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -488,7 +488,7 @@  static efi_status_t eficonfig_file_selected(void *data)
 	if (!info)
 		return EFI_INVALID_PARAMETER;
 
-	if (!strcmp(info->file_name, "..")) {
+	if (!strcmp(info->file_name, "..\\")) {
 		struct eficonfig_filepath_info *iter;
 		struct list_head *pos, *n;
 		int is_last;