Even though that works fine on the command line.
}
}
+ 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;