mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00: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 parent
dc49b523d1
commit
8355c37285
1 file changed
+1
-1
+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