From nobody Fri May 3 13:47:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=outlook.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1525565248252521.5587254841585; Sat, 5 May 2018 17:07:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D39CC203BEA25; Sat, 5 May 2018 17:07:26 -0700 (PDT) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-oln040092068079.outbound.protection.outlook.com [40.92.68.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CCB53203BB54B for ; Sat, 5 May 2018 17:07:24 -0700 (PDT) Received: from HE1EUR02FT027.eop-EUR02.prod.protection.outlook.com (10.152.10.57) by HE1EUR02HT050.eop-EUR02.prod.protection.outlook.com (10.152.11.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.13; Sun, 6 May 2018 00:07:17 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com (10.152.10.56) by HE1EUR02FT027.mail.protection.outlook.com (10.152.10.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.735.16 via Frontend Transport; Sun, 6 May 2018 00:07:17 +0000 Received: from VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7c79:584b:2e12:783e]) by VI1PR0801MB1790.eurprd08.prod.outlook.com ([fe80::7c79:584b:2e12:783e%17]) with mapi id 15.20.0715.024; Sun, 6 May 2018 00:07:17 +0000 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.92.68.79; helo=eur02-he1-obe.outbound.protection.outlook.com; envelope-from=marvin.haeuser@outlook.com; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=u40S9poF1wSAt2qibf8WLmOrljdwLZ/3aehAM1Vrimk=; b=ocdzoWD+J1lDc3f6itCctDkLSXSAauLfHLg8Bq1Vw8OmV8B9A3rXAxUiFfXorPSih00H5x0lVrVuE0vLkwZMUWd+Dp0Mu4k12tMnMSFWR517f1seFeFPpKro6V17OC+XeN2DC7T0GB5dYRGYQAJtHSZba2q+QRY+FupbSJk/xf1dwHaOG0fJfSNCCLTe0pXwwONGbuC/B5ZWAKBkmVsFFMToGRlUmqvNzoykUpGNm9dCZ2hwiW0BOFeVrT9AH61rgaQ11Z+DT2WXxM5w2swEATFVmKfGkyDx+HoUX+8c/Fr01hFoEh5p87xTESGLRkNVqeBzkcqKw1Nl9R9CMDxN9g== From: =?iso-8859-1?Q?Marvin_H=E4user?= To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] ShellPkg/UefiShellCommandLib: Do not error-exit when PlatformLang is missing. Thread-Index: AQHT5M4x2p+7xjSY4kKnvBuynpxkPw== Date: Sun, 6 May 2018 00:07:17 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR06CA0026.eurprd06.prod.outlook.com (2603:10a6:208:ab::39) To VI1PR0801MB1790.eurprd08.prod.outlook.com (2603:10a6:800:5b::15) x-incomingtopheadermarker: OriginalChecksum:DDE1DEF37F1C83B9896312921752D2EB459316DAB6B7923C7CE081CB597C681A; UpperCasedChecksum:50E37292CDAC90822994F8928C1E86F21191705843B7E96987AD08D8007ECE1F; SizeAsReceived:7512; Count:48 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [WaJiKzZVzg3UFwcG4Wvb4r+fZwF/Te8L] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1EUR02HT050; 7:+SHGQOAilMlIYMNtZ8C86j58V/4FiY1b2Q2k2Qdf+3qu7IHRlwRDucgltySBW8ZlbBptst4sqxI5wUZSrGNZ6DPXcqkOm3QcULjmdZIaoGvcodpDm3GuTAzyj/zLjmqYF5+2LojWs3FWuCLDnSHISxFnfsLDeyON47n3JyGVLWVMOuLaS8yJak2wgyPbEwxfpcCuQZd5/AXxttC+ZlUmR6fALiHEZR8jHuJh5Xhipqoz/Rk+vCsYC59GH5BJ5/Kr x-incomingheadercount: 48 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045); SRVR:HE1EUR02HT050; x-ms-traffictypediagnostic: HE1EUR02HT050: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:HE1EUR02HT050; BCL:0; PCL:0; RULEID:; SRVR:HE1EUR02HT050; x-forefront-prvs: 06640999CA x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:HE1EUR02HT050; H:VI1PR0801MB1790.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:; x-microsoft-antispam-message-info: dB+CjO9SkhqDQQqkOBCrG5eivL3pIg6FegK+sx8Srt5PWT/Q+joIgmWd6vzrq6AxHZFbUthpkOlY0/eUUT3wfh1cIZBFFf0IL0f/EB6Wvod2hqOPdpK3vGd35ZKKuDJ2bz2Da3ehU4WP5La8XcrK5SJcjlxdJA6kRDk8tiJbWEMvedd2benyoSRS5p4z0nFU MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 9f643519-3e1e-45d7-1d36-08d5b2e55414 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-Network-Message-Id: 9f643519-3e1e-45d7-1d36-08d5b2e55414 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 7181d4b0-87d6-4f4e-ba33-0d3746212cec X-MS-Exchange-CrossTenant-originalarrivaltime: 06 May 2018 00:07:17.5808 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR02HT050 Subject: [edk2] [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: , Cc: "jaben.carsey@intel.com" , "ruiyu.ni@intel.com" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jaben Carsey Reviewed-by: Ruiyu Ni --- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/S= hellPkg/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**)&Platfor= mLang, 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; --=20 2.17.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel