[PATCH] fixup! setenv: align with POSIX in handling of setenv(var, "")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>

---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux