chiark / gitweb /
fileio: also escape $ and ` when writing out env vars
[elogind.git] / src / shared / install.c
index b368b9f9ab1eae2fa952b458669b500f633ab2d1..75d6ca36192b9a1e59f6b3cef7e021af208230b4 100644 (file)
@@ -921,15 +921,15 @@ static int install_info_add_auto(
                 return install_info_add(c, name_or_path, NULL);
 }
 
-static int config_parse_also(
-                const char *filename,
-                unsigned line,
-                const char *section,
-                const char *lvalue,
-                int ltype,
-                const char *rvalue,
-                void *data,
-                void *userdata) {
+static int config_parse_also(const char *unit,
+                             const char *filename,
+                             unsigned line,
+                             const char *section,
+                             const char *lvalue,
+                             int ltype,
+                             const char *rvalue,
+                             void *data,
+                             void *userdata) {
 
         char *w;
         size_t l;
@@ -956,15 +956,15 @@ static int config_parse_also(
         return 0;
 }
 
-static int config_parse_user(
-                const char *filename,
-                unsigned line,
-                const char *section,
-                const char *lvalue,
-                int ltype,
-                const char *rvalue,
-                void *data,
-                void *userdata) {
+static int config_parse_user(const char *unit,
+                             const char *filename,
+                             unsigned line,
+                             const char *section,
+                             const char *lvalue,
+                             int ltype,
+                             const char *rvalue,
+                             void *data,
+                             void *userdata) {
 
         InstallInfo *i = data;
         char* printed;
@@ -1016,7 +1016,8 @@ static int unit_file_load(
                 return -ENOMEM;
         }
 
-        r = config_parse(path, f, NULL, config_item_table_lookup, (void*) items, true, info);
+        r = config_parse(NULL, path, f, NULL,
+                         config_item_table_lookup, (void*) items, true, info);
         if (r < 0)
                 return r;
 
@@ -1699,7 +1700,7 @@ int unit_file_query_preset(UnitFileScope scope, const char *name) {
                         if (!*l)
                                 continue;
 
-                        if (strchr(COMMENTS, *l))
+                        if (strchr(COMMENTS "\n", *l))
                                 continue;
 
                         if (first_word(l, "enable")) {
@@ -1735,7 +1736,7 @@ int unit_file_preset(
                 unsigned *n_changes) {
 
         LookupPaths _cleanup_lookup_paths_free_ paths = {};
-        InstallContext _cleanup_install_context_done_ plus = {}, minus = {NULL};
+        InstallContext _cleanup_install_context_done_ plus = {}, minus = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         Set _cleanup_set_free_free_ *remove_symlinks_to = NULL;