***/
#include <limits.h>
-#include <sys/param.h>
#include <unistd.h>
#include "strv.h"
#include "util.h"
#include "env-util.h"
#include "def.h"
-#include "unit.h"
#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
return strv_env_get_n(l, name, strlen(name));
}
-char **strv_env_clean_log(char **e, const char *unit_id, 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_unit(unit_id, "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, NULL);
-}