]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
env: ignore only invalid environment variables
authorTobias Stoeckmann <tobias@stoeckmann.org>
Thu, 8 Jan 2026 20:55:10 +0000 (21:55 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 9 Jan 2026 20:10:15 +0000 (21:10 +0100)
Returning NULL drops the start of the currently existing linked list,
effectively removing all previously added environment variables.

Only ignore the invalid one, but keep the linked list available.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/env.c

index e5e66337fcefe047bef437cd8e089ae5d073e4bf..e459959e0782929870547574d99c79f5b51820a1 100644 (file)
--- a/lib/env.c
+++ b/lib/env.c
@@ -97,7 +97,7 @@ static struct ul_env_list *env_list_add_from_string(struct ul_env_list *ls,
 
        val = strchr(str, '=');
        if (!val)
-               return NULL;
+               return ls;
        namesz = val - str;
 
        val++;