From nobody Fri Dec 27 01:40:43 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501149940024615.3241909547942; Thu, 27 Jul 2017 03:05:40 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2F92521D09194; Thu, 27 Jul 2017 03:03:30 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 88BAA21D09185 for ; Thu, 27 Jul 2017 03:03:28 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2017 03:05:32 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.23]) by orsmga004.jf.intel.com with ESMTP; 27 Jul 2017 03:05:31 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,419,1496127600"; d="scan'208";a="112536173" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Thu, 27 Jul 2017 18:05:29 +0800 Message-Id: <20170727100529.58208-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [edk2] [PATCH] ShellPkg/setvar: Check the duplicate flag X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: LI Huajing MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: LI Huajing Signed-off-by: Huajing Li Reviewed-by: Ruiyu Ni --- ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c | 4 = ++++ .../Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni | 1 + 2 files changed, 5 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPk= g/Library/UefiShellDebug1CommandsLib/SetVar.c index 8fb918d082..b7d3bbdc03 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c @@ -384,6 +384,10 @@ ShellCommandRunSetVar ( } else { ASSERT(FALSE); } + } else if (ShellCommandLineCheckDuplicate (Package,&ProblemParam) !=3D E= FI_SUCCESS) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShe= llDebug1HiiHandle, L"setvar", ProblemParam); =20 + FreePool(ProblemParam); + ShellStatus =3D SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetCount(Package) < 2) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShell= Debug1HiiHandle, L"setvar"); =20 diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com= mandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni index ee726cbbd4..f733a67f0b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -32,6 +32,7 @@ =20 #string STR_GEN_PROBLEM #language en-US "%H%s%N: Unknown flag - = '%H%s%N'\r\n" #string STR_GEN_PROBLEM_VAL #language en-US "%H%s%N: Bad value - '%H= %s%N' for flag - '%H%s%N'\r\n" +#string STR_GEN_DUPLICATE #language en-US "%H%s%N: Duplicate flag = - '%H%s%N'\r\n" #string STR_GEN_NO_VALUE #language en-US "%H%s%N: Missing argumen= t for flag - '%H%s%N'\r\n" #string STR_GEN_TOO_FEW #language en-US "%H%s%N: Too few argumen= ts.\r\n" #string STR_GEN_TOO_MANY #language en-US "%H%s%N: Too many argume= nts.\r\n" --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel