X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Ftincctl.c;h=5f24ae4d5d5771763025f34a45396a020afa06c3;hb=e5e96882c3825cee81ff163490b2f39fad3192b8;hp=f519e78d37792b07b3182a767e970f84336ba243;hpb=18237e1f2d9dd5eef4a4e0d746d016bf94a42ad4;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index f519e78d..5f24ae4d 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1461,14 +1461,12 @@ static int cmd_edit(int argc, char *argv[]) { } } + char *command; #ifndef HAVE_MINGW - char *editor = getenv("VISUAL") ?: getenv("EDITOR") ?: "vi"; + xasprintf(&command, "\"%s\" \"%s\"", getenv("VISUAL") ?: getenv("EDITOR") ?: "vi", filename); #else - char *editor = "edit"; + xasprintf(&command, "edit \"%s\"", filename); #endif - - char *command; - xasprintf(&command, "\"%s\" \"%s\"", editor, filename); int result = system(command); if(result) return result;