From patchwork Tue Oct 8 12:20:27 2013
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pierre Aubert
X-Patchwork-Id: 281431
X-Patchwork-Delegate: trini@ti.com
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 E36B02C03A2
for ;
Tue, 8 Oct 2013 23:21:30 +1100 (EST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 9323C4A08B;
Tue, 8 Oct 2013 14:21:27 +0200 (CEST)
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 mIhaqSFg1W61; Tue, 8 Oct 2013 14:21:27 +0200 (CEST)
Received: from theia.denx.de (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 857F34A090;
Tue, 8 Oct 2013 14:21:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 525A74A090
for ; Tue, 8 Oct 2013 14:21:22 +0200 (CEST)
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 Rv8+Vo5QuMAf for ;
Tue, 8 Oct 2013 14:21:16 +0200 (CEST)
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 esa1.staubli.c3s2.iphmx.com (esa1.staubli.c3s2.iphmx.com
[68.232.133.30]) by theia.denx.de (Postfix) with ESMTPS id 4DF3F4A08B
for ; Tue, 8 Oct 2013 14:21:10 +0200 (CEST)
X-IronPort-AV: E=Sophos;i="4.90,1056,1371074400"; d="scan'208";a="6909830"
Received: from unknown (HELO fav03not.staubli.pri) ([217.109.88.35])
by esa1.staubli.c3s2.iphmx.com with ESMTP; 08 Oct 2013 14:21:05 +0200
Received: from favd8744.staubli.pri ([10.10.100.28])
by fav03not.staubli.pri (Lotus Domino Release 8.5.1FP5)
with ESMTP id 2013100814210450-10268 ;
Tue, 8 Oct 2013 14:21:04 +0200
Received: from favd8744.staubli.pri (localhost [127.0.0.1])
by favd8744.staubli.pri (8.14.5/8.14.5) with ESMTP id r98CL4bp018843;
Tue, 8 Oct 2013 14:21:04 +0200
Received: (from aubert@localhost)
by favd8744.staubli.pri (8.14.5/8.14.5/Submit) id r98CKxn0018842;
Tue, 8 Oct 2013 14:20:59 +0200
From: Pierre Aubert
To: u-boot@lists.denx.de
Date: Tue, 8 Oct 2013 14:20:27 +0200
Message-Id:
<4accd97bbc9fe967a5a9034deb6596a577936f20.1381233825.git.p.aubert@staubli.com>
X-Mailer: git-send-email 1.7.6.5
X-MIMETrack: Itemize by SMTP Server on FAV03NOT/FAVERGES/STAUBLI(Release
8.5.1FP5|September 29, 2010) at 08/10/2013 14:21:04,
Serialize by Router on FAV03NOT/FAVERGES/STAUBLI(Release
8.5.1FP5|September 29, 2010) at 08/10/2013 14:21:04,
Serialize complete at 08/10/2013 14:21:04
Cc: Pierre Aubert
Subject: [U-Boot] [PATCH] env: fix the env export varname
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.11
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 export command doesn't export the first variable of the list
since commit 5a31ea04c9ee5544fbb70ad7597ea4b294840eab
"env grep" - reimplement command using hexport_r()
Signed-off-by: Pierre Aubert
---
common/cmd_nvedit.c | 6 ++----
lib/hashtable.c | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 778dca5..c249286 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -157,10 +157,8 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
grep_how = H_MATCH_SUBSTR; /* default: substring search */
grep_what = H_MATCH_BOTH; /* default: grep names and values */
- while (argc > 1 && **(argv + 1) == '-') {
- char *arg = *++argv;
-
- --argc;
+ while (--argc > 0 && **++argv == '-') {
+ char *arg = *argv;
while (*++arg) {
switch (*arg) {
#ifdef CONFIG_REGEX
diff --git a/lib/hashtable.c b/lib/hashtable.c
index c5a2b08..4356b23 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -564,7 +564,7 @@ static int match_entry(ENTRY *ep, int flag,
int arg;
void *priv = NULL;
- for (arg = 1; arg < argc; ++arg) {
+ for (arg = 0; arg < argc; ++arg) {
#ifdef CONFIG_REGEX
struct slre slre;