From 9391a1c3d6c94c478b0016a81df3f874fd99260e Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 3 Jun 2015 14:00:59 +0200 Subject: systemctl: Use /usr/bin/editor if available If the EDITOR environment variable is not set, the Debian policy recommends to use the /usr/bin/editor program as default editor. This file is managed via the dpkg alternatives mechanism and typically used in Debian/Ubuntu and derivatives to configure the default editor. See section 11.4 of the Debian policy [1]. Therefor prefer /usr/bin/editor over specific editors if available. [1] https://www.debian.org/doc/debian-policy/ch-customized-programs.html --- src/systemctl/systemctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/systemctl') diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index a7b8e54a9c..b3d90d2c33 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5879,7 +5879,7 @@ static int run_editor(char **paths) { execvp(editor, (char* const*) args); } - FOREACH_STRING(p, "nano", "vim", "vi") { + FOREACH_STRING(p, "editor", "nano", "vim", "vi") { args[0] = p; execvp(p, (char* const*) args); /* We do not fail if the editor doesn't exist -- cgit v1.2.3-54-g00ecf