From patchwork Wed Nov 24 12:07:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Weber X-Patchwork-Id: 72844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id EF341B708B for ; Wed, 24 Nov 2010 23:08:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 73755280CD; Wed, 24 Nov 2010 13:08:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v4Pg--qNjgmE; Wed, 24 Nov 2010 13:08:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9793280D5; Wed, 24 Nov 2010 13:08:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BE00280D5 for ; Wed, 24 Nov 2010 13:08:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aOosWFlQih6R for ; Wed, 24 Nov 2010 13:08:38 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by theia.denx.de (Postfix) with ESMTP id 05758280CD for ; Wed, 24 Nov 2010 13:08:36 +0100 (CET) Received: from corscience.de (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Mgpfs-1P877M16Lg-00M6Z4; Wed, 24 Nov 2010 13:08:36 +0100 Received: from Lupus.CS.local (unknown [192.168.102.87]) by corscience.de (Postfix) with ESMTP id AE40A5209B; Wed, 24 Nov 2010 13:08:35 +0100 (CET) From: Thomas Weber To: u-boot@lists.denx.de Date: Wed, 24 Nov 2010 13:07:52 +0100 Message-Id: <1290600472-23147-2-git-send-email-weber@corscience.de> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20101124110719.C428C135EA0@gemini.denx.de> References: <20101124110719.C428C135EA0@gemini.denx.de> X-Provags-ID: V02:K0:VkxT5groNTmBnZpDBKx/IPSM5qVA2BsTixncrxQx3Gu Nu9LBV+R1PuEQV3wMiVMU+cjmIdUD46l/fn+s7t2uA3pVs2vrn XhiHFA0yEDbezx/4WHDM3aK0wQRGLkO+dVUJ0LkCbdEpb2GJRy 7X/6S0yUM3elQfhHMsRi0i2B4DfWgueq3pLvCOwKPD5xXHaXyI SOt2yYhmG8aUflygmSQ2g== Cc: Thomas Weber Subject: [U-Boot] [RFC/PATCHv2 2/2] Common/cmd_nvedit: Check for env subcommand X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The env command needs one subcommand. If this is not available print the usage help. Signed-off-by: Thomas Weber --- common/cmd_nvedit.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 3fd8abc..52c5e7c 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -848,6 +848,9 @@ static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *cp; + if (argc < 2) + return cmd_usage(cmdtp); + /* drop initial "env" arg */ argc--; argv++;