initctl: fix logic in edit command fallback handling

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-02-26 11:08:03 +01:00
parent 6b1ba37438
commit 7439fa0c2a
+5 -5
View File
@@ -221,11 +221,11 @@ int serv_edit(char *arg)
if (!fexist(path))
return serv_list(NULL);
return systemf("[ -x \"$(command -v sensible-editor)\" ] && sensible-editor %s", path) || \
systemf("[ -x \"$(command -v editor)\" ] && editor %s", path) || \
systemf("${VISUAL:-${EDITOR:-$(command -v vi)}} %s", path) || \
systemf("[ -x \"$(command -v mg)\" ] && mg %s", path) || \
systemf("[ -x \"$(command -v vi)\" ] && vi %s", path);
return !systemf("[ -x \"$(command -v sensible-editor)\" ] && sensible-editor %s", path) || \
!systemf("[ -x \"$(command -v editor)\" ] && editor %s", path) || \
!systemf("${VISUAL:-${EDITOR:-$(command -v vi)}} %s", path) || \
!systemf("[ -x \"$(command -v mg)\" ] && mg %s", path) || \
!systemf("[ -x \"$(command -v vi)\" ] && vi %s", path);
}
/**