chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
importd: when listing transfers, show progress percentage
[elogind.git]
/
src
/
shared
/
env-util.c
diff --git
a/src/shared/env-util.c
b/src/shared/env-util.c
index b2e45531ab7ec0131e102075bc9b09397dfe0fb1..038246d21b7cd134fa34997be73d036d9ac036b2 100644
(file)
--- a/
src/shared/env-util.c
+++ b/
src/shared/env-util.c
@@
-78,7
+78,9
@@
bool env_value_is_valid(const char *e) {
if (!utf8_is_valid(e))
return false;
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 false;
/* POSIX says the overall size of the environment block cannot
@@
-412,7
+414,7
@@
char *strv_env_get(char **l, const char *name) {
return strv_env_get_n(l, name, strlen(name));
}
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;
char **p, **q;
int k = 0;
@@
-421,8
+423,8
@@
char **strv_env_clean_log(char **e, const char *message) {
bool duplicate = false;
if (!env_assignment_is_valid(*p)) {
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;
}
free(*p);
continue;
}
@@
-447,7
+449,3
@@
char **strv_env_clean_log(char **e, const char *message) {
return e;
}
return e;
}
-
-char **strv_env_clean(char **e) {
- return strv_env_clean_log(e, NULL);
-}