return TAKE_PTR(t);
}
-char **strv_env_unset(char **l, const char *p) {
- char **f, **t;
+char** strv_env_unset(char **l, const char *p) {
+ assert(p);
if (!l)
return NULL;
- assert(p);
-
/* Drops every occurrence of the env var setting p in the
* string list. Edits in-place. */
+ char **f, **t;
for (f = t = l; *f; f++) {
-
if (env_match(*f, p)) {
free(*f);
continue;
return l;
}
-char **strv_env_unset_many(char **l, ...) {
- char **f, **t;
-
+char** strv_env_unset_many_internal(char **l, ...) {
if (!l)
return NULL;
/* Like strv_env_unset() but applies many at once. Edits in-place. */
+ char **f, **t;
for (f = t = l; *f; f++) {
bool found = false;
const char *p;
va_start(ap, l);
- while ((p = va_arg(ap, const char*))) {
+ while ((p = va_arg(ap, const char*)))
if (env_match(*f, p)) {
found = true;
break;
}
- }
va_end(ap);
#define strv_env_merge(first, ...) _strv_env_merge(first, __VA_ARGS__, POINTER_MAX)
char **strv_env_delete(char **x, size_t n_lists, ...); /* New copy */
-char **strv_env_unset(char **l, const char *p); /* In place ... */
-char **strv_env_unset_many(char **l, ...) _sentinel_;
+char** strv_env_unset(char **l, const char *p); /* In place ... */
+char** strv_env_unset_many_internal(char **l, ...) _sentinel_;
+#define strv_env_unset_many(l, ...) strv_env_unset_many_internal(l, __VA_ARGS__, NULL)
int strv_env_replace_consume(char ***l, char *p); /* In place ... */
int strv_env_replace_strdup(char ***l, const char *assignment);
int strv_env_replace_strdup_passthrough(char ***l, const char *assignment);
"TRIGGER_TIMER_REALTIME_USEC",
"TRIGGER_UNIT",
"WATCHDOG_PID",
- "WATCHDOG_USEC",
- NULL);
+ "WATCHDOG_USEC");
/* Let's order the environment alphabetically, just to make it pretty */
return strv_sort(l);