mirror of
https://github.com/troglobit/finit.git
synced 2026-10-05 07:13:44 +07:00
initctl: fix edit command fallback handling
If mg doesn't exist, command doesn't evaluate the second argument (vi), so we need to use `... || command -v vi` instead. Found during demo, because why not. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -270,7 +270,7 @@ static int do_edit(char *arg, int creat)
|
||||
char *editor[] = {
|
||||
"sensible-editor",
|
||||
"editor",
|
||||
"${VISUAL:-${EDITOR:-$(command -v mg vi | head -1)}}"
|
||||
"${VISUAL:-${EDITOR:-$(command -v mg || command -v vi)}}"
|
||||
};
|
||||
char path[256];
|
||||
char *fn;
|
||||
|
||||
Reference in New Issue
Block a user