Windows doesn't like quotes around "edit" when calling it through system().
Even though that works fine on the command line.
This commit is contained in:
parent
18237e1f2d
commit
e5e96882c3
1 changed files with 5 additions and 7 deletions
|
@ -1461,14 +1461,12 @@ static int cmd_edit(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_MINGW
|
|
||||||
char *editor = getenv("VISUAL") ?: getenv("EDITOR") ?: "vi";
|
|
||||||
#else
|
|
||||||
char *editor = "edit";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *command;
|
char *command;
|
||||||
xasprintf(&command, "\"%s\" \"%s\"", editor, filename);
|
#ifndef HAVE_MINGW
|
||||||
|
xasprintf(&command, "\"%s\" \"%s\"", getenv("VISUAL") ?: getenv("EDITOR") ?: "vi", filename);
|
||||||
|
#else
|
||||||
|
xasprintf(&command, "edit \"%s\"", filename);
|
||||||
|
#endif
|
||||||
int result = system(command);
|
int result = system(command);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue