From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Marvin Häuser" <Marvin.Haeuser@outlook.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing.
Date: Thu, 17 May 2018 08:00:30 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BC9E89A@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <VI1PR0801MB1790A89071C6BB3501F3109680840@VI1PR0801MB1790.eurprd08.prod.outlook.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: Marvin Häuser <Marvin.Haeuser@outlook.com>
> Sent: Sunday, May 6, 2018 8:07 AM
> 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.
>
> 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
prev parent reply other threads:[~2018-05-17 8:00 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
2018-05-17 8:00 ` Ni, Ruiyu [this message]
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=734D49CCEBEEF84792F5B80ED585239D5BC9E89A@SHSMSX104.ccr.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