diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-16 02:02:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-16 02:03:35 +0200 |
commit | 7640a5de1b3ffe6547200ad204d14e4f067caf4f (patch) | |
tree | 230ab4d99226ac63fa17daa1428c490ee37912ad /src/strv.c | |
parent | 25e3655a00ba41424c95222aba71c543e84fd3e3 (diff) |
hostnamed: introduce systemd-hostnamed
http://www.freedesktop.org/wiki/Software/systemd/hostnamed
Diffstat (limited to 'src/strv.c')
-rw-r--r-- | src/strv.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/strv.c b/src/strv.c index 1c15ee802c..71b77c9bbf 100644 --- a/src/strv.c +++ b/src/strv.c @@ -525,6 +525,32 @@ char **strv_env_delete(char **x, unsigned n_lists, ...) { return r; } +char **strv_env_unset(char **l, const char *p) { + + char **f, **t; + + if (!l) + return NULL; + + assert(p); + + /* Drops every occurrence of the env var setting p in the + * string list. edits in-place. */ + + for (f = t = l; *f; f++) { + + if (env_match(*f, p)) { + free(*f); + continue; + } + + *(t++) = *f; + } + + *t = NULL; + return l; +} + char **strv_env_set(char **x, const char *p) { char **k, **r; |