if (!utf8_is_valid(e))
return false;
- if (string_has_cc(e))
+ /* bash allows tabs in environment variables, and so should
+ * we */
+ if (string_has_cc(e, "\t"))
return false;
/* POSIX says the overall size of the environment block cannot
return strv_env_get_n(l, name, strlen(name));
}
-char **strv_env_clean_log(char **e, const char *message) {
+char **strv_env_clean_with_callback(char **e, void (*invalid_callback)(const char *p, void *userdata), void *userdata) {
char **p, **q;
int k = 0;
bool duplicate = false;
if (!env_assignment_is_valid(*p)) {
- if (message)
- log_error("Ignoring invalid environment '%s': %s", *p, message);
+ if (invalid_callback)
+ invalid_callback(*p, userdata);
free(*p);
continue;
}
return e;
}
-
-char **strv_env_clean(char **e) {
- return strv_env_clean_log(e, NULL);
-}