Let's use first_word() instead of startswith(), it's more explanatory
and a bit more correct. Also, let's use the return value instead of
adding +9 when looking for the second part of the directive.
char *l,
void *userdata) {
- char *e;
+ char *e, *include;
assert(filename);
assert(line > 0);
if (strchr(COMMENTS "\n", *l))
return 0;
- if (startswith(l, ".include ")) {
+ include = first_word(l, ".include");
+ if (include) {
_cleanup_free_ char *fn = NULL;
/* .includes are a bad idea, we only support them here
".include directives are deprecated, and support for them will be removed in a future version of systemd. "
"Please use drop-in files instead.");
- fn = file_in_same_dir(filename, strstrip(l+9));
+ fn = file_in_same_dir(filename, strstrip(include));
if (!fn)
return -ENOMEM;