mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: skip the space before the argument of an entry
An entry written in aligned columns got the space after the age field
as part of its argument:
L /tmp/null - - - - /dev/null
This made a link to " /dev/null". Only the first separator after
the age was dropped. A lone "-" for no argument was also taken as is,
so an f entry with it made a file holding a dash.
Skip all the space before the argument, and read "-" as no argument.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+42
No files matched your search
@@ -430,6 +430,11 @@ static void tmpfiles(char *line)
|
||||
|
||||
age = strtok(NULL, "\t ");
|
||||
arg = strtok(NULL, "\n");
|
||||
if (arg) {
|
||||
arg += strspn(arg, "\t ");
|
||||
if (!arg[0] || !strcmp(arg, "-"))
|
||||
arg = NULL;
|
||||
}
|
||||
|
||||
strc = stat(path, &st);
|
||||
|
||||
|
||||
Reference in new issue
Block a user