mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: stop at a backslash that ends the argument
write_arg() takes the character after a backslash as an escape. With the backslash last in the argument that character is the end of the string, and the loop went on reading past it. fparseln() takes a backslash at the end of a line as a continuation, so an argument does not end in one today. Write the backslash as it is and stop, should that change. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 file changed
+4
@@ -254,6 +254,10 @@ static void write_arg(FILE *fp, char *arg)
|
|||||||
fwrite(arg, sizeof(char), p - arg, fp);
|
fwrite(arg, sizeof(char), p - arg, fp);
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
|
if (!*p) { /* A backslash that ends the argument */
|
||||||
|
arg = p - 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case '\\':
|
case '\\':
|
||||||
fputc('\\', fp);
|
fputc('\\', fp);
|
||||||
|
|||||||
Reference in new issue
Block a user