mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 23:21:22 +03:00
xdg-autostart: minor refactoring
We can't say free_and_replace(exec_split[n++], quoted), because the the argument is evaluated multiple times. But I think that this form is still easier to read.
This commit is contained in:
parent
12d729b2ec
commit
2744c7bb01
@ -416,8 +416,8 @@ int xdg_autostart_format_exec_start(
|
||||
if (!escaped)
|
||||
return log_oom();
|
||||
|
||||
free(exec_split[n]);
|
||||
exec_split[n++] = TAKE_PTR(escaped);
|
||||
free_and_replace(exec_split[n], escaped);
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -457,8 +457,8 @@ int xdg_autostart_format_exec_start(
|
||||
if (!quoted)
|
||||
return log_oom();
|
||||
|
||||
free(exec_split[n]);
|
||||
exec_split[n++] = TAKE_PTR(quoted);
|
||||
free_and_replace(exec_split[n], quoted);
|
||||
n++;
|
||||
}
|
||||
for (; exec_split[n]; n++)
|
||||
exec_split[n] = mfree(exec_split[n]);
|
||||
|
Loading…
Reference in New Issue
Block a user