diff options
Diffstat (limited to 'src/basic/env-util.c')
-rw-r--r-- | src/basic/env-util.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 9ddac5d6a1..441169db31 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -138,6 +138,21 @@ bool strv_env_is_valid(char **e) { return true; } +bool strv_env_name_is_valid(char **l) { + char **p, **q; + + STRV_FOREACH(p, l) { + if (!env_name_is_valid(*p)) + return false; + + STRV_FOREACH(q, p + 1) + if (streq(*p, *q)) + return false; + } + + return true; +} + bool strv_env_name_or_assignment_is_valid(char **l) { char **p, **q; |