void *data,
void *userdata) {
- bool *b = data;
+ bool *b = ASSERT_PTR(data);
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
if (streq(rvalue, "true"))
*b = true;
void *userdata) {
_cleanup_free_ char *res = NULL;
- char **out = data;
+ char **out = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
/* XDG does not allow duplicate definitions. */
if (*out) {
void *data,
void *userdata) {
- char ***ret_sv = data;
+ char ***ret_sv = ASSERT_PTR(data);
int r;
assert(filename);
assert(lvalue);
assert(rvalue);
- assert(data);
/* XDG does not allow duplicate definitions. */
if (*ret_sv) {
const void *table,
const char *section,
const char *lvalue,
- ConfigParserCallback *func,
- int *ltype,
- void **data,
+ ConfigParserCallback *ret_func,
+ int *ret_ltype,
+ void **ret_data,
void *userdata) {
assert(lvalue);
/* Ignore any keys with [] as those are translations. */
if (strchr(lvalue, '[')) {
- *func = NULL;
- *ltype = 0;
- *data = NULL;
+ *ret_func = NULL;
+ *ret_ltype = 0;
+ *ret_data = NULL;
return 1;
}
- return config_item_table_lookup(table, section, lvalue, func, ltype, data, userdata);
+ return config_item_table_lookup(table, section, lvalue, ret_func, ret_ltype, ret_data, userdata);
}
XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path) {
first_arg = true;
for (i = n = 0; exec_split[i]; i++) {
- _cleanup_free_ char *c = NULL, *raw = NULL, *p = NULL, *escaped = NULL, *quoted = NULL;
+ _cleanup_free_ char *c = NULL, *raw = NULL, *percent = NULL;
ssize_t l;
l = cunescape(exec_split[i], 0, &c);
if (r < 0)
return log_info_errno(r, "Exec binary '%s' does not exist: %m", c);
- escaped = cescape(executable);
- if (!escaped)
- return log_oom();
-
- free_and_replace(exec_split[n++], escaped);
+ free_and_replace(exec_split[n++], executable);
continue;
}
raw = strreplace(c, "%%", "%");
if (!raw)
return log_oom();
- p = strreplace(raw, "%", "%%");
- if (!p)
- return log_oom();
- escaped = cescape(p);
- if (!escaped)
- return log_oom();
-
- quoted = strjoin("\"", escaped, "\"");
- if (!quoted)
+ percent = strreplace(raw, "%", "%%");
+ if (!percent)
return log_oom();
- free_and_replace(exec_split[n++], quoted);
+ free_and_replace(exec_split[n++], percent);
}
for (; exec_split[n]; n++)
exec_split[n] = mfree(exec_split[n]);
- res = strv_join(exec_split, " ");
+ res = quote_command_line(exec_split, SHELL_ESCAPE_EMPTY);
if (!res)
return log_oom();
if (!e_autostart_condition)
return log_oom();
- log_debug("%s: ExecCondition converted to %s --condition \"%s\"…",
- service->path, gnome_autostart_condition_path, e_autostart_condition);
+ log_debug("%s: ExecCondition converted to %s --condition \"%s\"%s",
+ service->path, gnome_autostart_condition_path, e_autostart_condition,
+ special_glyph(SPECIAL_GLYPH_ELLIPSIS));
fprintf(f,
"ExecCondition=%s --condition \"%s\"\n",
if (r < 0)
return r;
- log_debug("%s: symlinking %s in xdg-desktop-autostart.target/.wants…", service->path, service->name);
+ log_debug("%s: symlinking %s in xdg-desktop-autostart.target/.wants%s",
+ service->path, service->name, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
return generator_add_symlink(dest, "xdg-desktop-autostart.target", "wants", service->name);
}