chiark / gitweb /
lookup: drop empty directories from search paths
[elogind.git] / src / path-lookup.c
index b39ce8b699784284a9f0189b2ea1a2e2369d8d79..b1c69814cade62115d1335087a0822dd970011dd 100644 (file)
@@ -205,6 +205,7 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
                         return -ENOMEM;
 
         strv_uniq(p->unit_path);
+        strv_path_remove_empty(p->unit_path);
 
         if (!strv_isempty(p->unit_path)) {
 
@@ -259,6 +260,9 @@ int lookup_paths_init(LookupPaths *p, ManagerRunningAs running_as) {
                 strv_uniq(p->sysvinit_path);
                 strv_uniq(p->sysvrcnd_path);
 
+                strv_path_remove_empty(p->sysvinit_path);
+                strv_path_remove_empty(p->sysvrcnd_path);
+
                 if (!strv_isempty(p->sysvinit_path)) {
 
                         if (!(t = strv_join(p->sysvinit_path, "\n\t")))