From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2ADA20961085 for ; Mon, 7 May 2018 11:10:35 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 11:10:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,375,1520924400"; d="scan'208";a="52253272" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 07 May 2018 11:10:35 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 7 May 2018 11:10:35 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.228]) by fmsmsx121.amr.corp.intel.com ([169.254.6.167]) with mapi id 14.03.0319.002; Mon, 7 May 2018 11:10:35 -0700 From: "Carsey, Jaben" To: =?iso-8859-1?Q?Marvin_H=E4user?= , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" Thread-Topic: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing. Thread-Index: AQHT5M4x2p+7xjSY4kKnvBuynpxkP6Qkk8AQ Date: Mon, 7 May 2018 18:10:34 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQ1NjAxODctNGQ3ZC00MDI0LWFlYzktMmYyMTJjYzBhYjE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IllqYm42QndnSStLU2hLKzdmNXdobVlTcnQyMjRRRWRzU2dTVUdxTWpFSUE9In0= x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2018 18:10:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: Marvin H=E4user [mailto:Marvin.Haeuser@outlook.com] > Sent: Saturday, May 05, 2018 5:07 PM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Ni, Ruiyu > Subject: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when > PlatformLang is missing. > Importance: High >=20 > 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. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marvin Haeuser > --- > ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 9 ++++---- > - > 1 file changed, 4 insertions(+), 5 deletions(-) >=20 > 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; >=20 > GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, > (VOID**)&PlatformLang, NULL); > - if (PlatformLang =3D=3D NULL) { > - return EFI_UNSUPPORTED; > - } >=20 > if (gUnicodeCollation =3D=3D NULL) { > Status =3D gBS->LocateHandleBuffer ( > @@ -120,7 +117,7 @@ CommandInit( > BestLanguage =3D GetBestLanguage ( > Uc->SupportedLanguages, > FALSE, > - PlatformLang, > + ((PlatformLang !=3D NULL) ? PlatformLang : "en-US= "), > NULL > ); > if (BestLanguage !=3D NULL) { > @@ -132,7 +129,9 @@ CommandInit( > if (Handles !=3D NULL) { > FreePool (Handles); > } > - FreePool (PlatformLang); > + if (PlatformLang !=3D NULL) { > + FreePool (PlatformLang); > + } > } >=20 > return (gUnicodeCollation =3D=3D NULL) ? EFI_UNSUPPORTED : EFI_SUCCESS= ; > -- > 2.17.0.windows.1