| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
strstrafter() is like strstr() but returns a pointer to the first
character *after* the found substring, not on the substring itself.
Quite often this is what we actually want.
Inspired by #27267 I think it makes sense to add a helper for this,
to avoid the potentially fragile manual pointer increment afterwards.
|
| |
|
|
|
|
|
|
|
| |
Before this commit, if `original_path` is given,
it will always be used to overwrite `path`.
After this commit, it's controlled by the newly-added
switch `overwrite_with_origin`.
|
| |
|
| |
|
|
|
|
|
| |
These are almost never used, so let's move them to the _full()
functions signatures.
|
| |
|
| |
|
|
|
|
| |
with some minor cleanups
|
|
|
|
| |
even if neither original_path nor comment_paths is specified.
|
|
|
|
|
| |
Reuse unlink_and_free() and avoid unnecessary
call to rmdir()
|
|
|
|
|
| |
Addresses the suggestion
https://github.com/systemd/systemd/pull/26756#discussion_r1133078705.
|
|
|
|
| |
This also makes trim_edit_markers() take EditFile as the argument.
|
|
|
|
| |
No functional changes, just refactoring.
|
|
|
|
| |
No functional change, just preparation for later commits.
|
|
|
|
|
|
| |
run_editor is now switched to heap allocation
for simplicity. The code for child is made into
an individual function for simpler error handling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a rather large change which moves
the add and install logic into edit-util.
We store an EditFile array and the number of
elements, along with the edit markers used in
temporary files and whether to remove the parent
directories of the target files if they're empty
in an EditFileContext object.
Call edit_files_add() to add an file to edit,
and do_edit_files_and_install() to do the actual
editing (through create_edit_temp_file(),
run_editor() and trim_edit_markers()).
After that, edit_file_context_done() can be used
to destroy the object.
|
|
|
|
|
|
|
| |
original_path and comment_paths can now be used
together.
Removes reference to "unit"
|
|
|