public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: "Marvin Häuser" <Marvin.Haeuser@outlook.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing.
Date: Mon, 7 May 2018 18:10:34 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515CA3CF2017@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <VI1PR0801MB1790A89071C6BB3501F3109680840@VI1PR0801MB1790.eurprd08.prod.outlook.com>

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
> Sent: Saturday, May 05, 2018 5:07 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when
> PlatformLang is missing.
> Importance: High
> 
> Currently, when the PlatformLang variable is missing,
> UefiShellCommandLib error-exits. To prevent the entire UEFI Shell
> from failing to load over a missing variable, "en-US" is assumed when
> the variable location fails.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 9 ++++----
> -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> index 0df252b42036..dfcfd2e0dd54 100644
> --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
> @@ -81,9 +81,6 @@ CommandInit(
>    CHAR8                           *PlatformLang;
> 
>    GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME,
> (VOID**)&PlatformLang, NULL);
> -  if (PlatformLang == NULL) {
> -    return EFI_UNSUPPORTED;
> -  }
> 
>    if (gUnicodeCollation == NULL) {
>      Status = gBS->LocateHandleBuffer (
> @@ -120,7 +117,7 @@ CommandInit(
>        BestLanguage = GetBestLanguage (
>                         Uc->SupportedLanguages,
>                         FALSE,
> -                       PlatformLang,
> +                       ((PlatformLang != NULL) ? PlatformLang : "en-US"),
>                         NULL
>                         );
>        if (BestLanguage != NULL) {
> @@ -132,7 +129,9 @@ CommandInit(
>      if (Handles != NULL) {
>        FreePool (Handles);
>      }
> -    FreePool (PlatformLang);
> +    if (PlatformLang != NULL) {
> +      FreePool (PlatformLang);
> +    }
>    }
> 
>    return (gUnicodeCollation == NULL) ? EFI_UNSUPPORTED : EFI_SUCCESS;
> --
> 2.17.0.windows.1



  reply	other threads:[~2018-05-07 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-06  0:07 [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing Marvin Häuser
2018-05-07 18:10 ` Carsey, Jaben [this message]
2018-05-17  8:00 ` Ni, Ruiyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB6E33457884FA40993F35157061515CA3CF2017@FMSMSX103.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox