From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,419,1496127600"; d="scan'208";a="112536173" 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 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: LI Huajing 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: [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: , X-List-Received-Date: Thu, 27 Jul 2017 10:03:28 -0000 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/ShellPkg/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) != EFI_SUCCESS) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam); + FreePool(ProblemParam); + ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellCommandLineGetCount(Package) < 2) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar"); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index ee726cbbd4..f733a67f0b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -32,6 +32,7 @@ #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 argument for flag - '%H%s%N'\r\n" #string STR_GEN_TOO_FEW #language en-US "%H%s%N: Too few arguments.\r\n" #string STR_GEN_TOO_MANY #language en-US "%H%s%N: Too many arguments.\r\n" -- 2.12.2.windows.2