mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! setenv: align with POSIX in handling of setenv(var, "")
Date: Fri, 13 Nov 2020 09:26:00 +0100	[thread overview]
Message-ID: <20201113082600.30578-1-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20201112172347.385-2-a.fatoum@pengutronix.de>

Previously setenv xxx= deleted x like xxx= does. With xxx= now instead
assigning the empty string, setenv xxx= should too.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

---
 commands/setenv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/commands/setenv.c b/commands/setenv.c
index 6992f604f513..9aeb8f010bc5 100644
--- a/commands/setenv.c
+++ b/commands/setenv.c
@@ -18,8 +18,7 @@ static int do_setenv(int argc, char *argv[])
 	equal = strrchr(argv[1], '=');
 	if (equal) {
 		equal[0] = '\0';
-		if (equal[1])
-			argv[2] = &equal[1];
+		argv[2] = &equal[1];
 	}
 
 	if (argv[2])
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-11-13  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 17:23 [PATCH 1/2] fs: introduce unsetenv() to prepare for changing setenv(var, "") behavior Ahmad Fatoum
2020-11-12 17:23 ` [PATCH 2/2] setenv: align with POSIX in handling of setenv(var, "") Ahmad Fatoum
2020-11-13  8:26   ` Ahmad Fatoum [this message]
2020-11-16  8:21     ` [PATCH] fixup! " Sascha Hauer
2020-11-16  8:58       ` Ahmad Fatoum
2020-11-23 15:48 ` [PATCH 1/2] fs: introduce unsetenv() to prepare for changing setenv(var, "") behavior Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113082600.30578-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox