mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 08:26:52 +03:00
Merge pull request #52 from mbiebl/systemctl-edit-default-editor
systemctl: Use /usr/bin/editor if available
This commit is contained in:
commit
21ee915614
@ -1733,6 +1733,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
|
|||||||
<varname>$VISUAL</varname> are present or if it is set to an empty
|
<varname>$VISUAL</varname> are present or if it is set to an empty
|
||||||
string or if their execution failed, systemctl will try to execute well
|
string or if their execution failed, systemctl will try to execute well
|
||||||
known editors in this order:
|
known editors in this order:
|
||||||
|
<citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||||
<citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
<citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||||
<citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
<citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||||
<citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
<citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
||||||
|
@ -5879,7 +5879,7 @@ static int run_editor(char **paths) {
|
|||||||
execvp(editor, (char* const*) args);
|
execvp(editor, (char* const*) args);
|
||||||
}
|
}
|
||||||
|
|
||||||
FOREACH_STRING(p, "nano", "vim", "vi") {
|
FOREACH_STRING(p, "editor", "nano", "vim", "vi") {
|
||||||
args[0] = p;
|
args[0] = p;
|
||||||
execvp(p, (char* const*) args);
|
execvp(p, (char* const*) args);
|
||||||
/* We do not fail if the editor doesn't exist
|
/* We do not fail if the editor doesn't exist
|
||||||
|
Loading…
Reference in New Issue
Block a user