summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-28 04:55:05 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-28 04:55:05 +0200
commita9dd208208e672a4fe5a3c2405946c1506e034db (patch)
tree42f069093153a5db7b78de55270dc4ef5ccbecff /src/util.c
parentac3f50caa50835a429fc59d9168799bbb6e24fb9 (diff)
lookup: drop empty directories from search paths
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 5029896ef0..6037455f70 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1209,6 +1209,26 @@ char **strv_path_canonicalize(char **l) {
return l;
}
+char **strv_path_remove_empty(char **l) {
+ char **f, **t;
+
+ if (!l)
+ return NULL;
+
+ for (f = t = l; *f; f++) {
+
+ if (dir_is_empty(*f) > 0) {
+ free(*f);
+ continue;
+ }
+
+ *(t++) = *f;
+ }
+
+ *t = NULL;
+ return l;
+}
+
int reset_all_signal_handlers(void) {
int sig;