mirror of https://github.com/decompals/wibo.git
Pass absolute path to exe in argv[0] (#31)
This commit is contained in:
parent
67f99ba1b2
commit
9837ce0bf4
9
main.cpp
9
main.cpp
|
@ -177,8 +177,13 @@ int main(int argc, char **argv) {
|
||||||
// Build a command line
|
// Build a command line
|
||||||
std::string cmdLine;
|
std::string cmdLine;
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (i != 1) cmdLine += ' ';
|
std::string arg;
|
||||||
std::string arg = argv[i];
|
if (i == 1) {
|
||||||
|
arg = files::pathToWindows(std::filesystem::absolute(argv[1]));
|
||||||
|
} else {
|
||||||
|
cmdLine += ' ';
|
||||||
|
arg = argv[i];
|
||||||
|
}
|
||||||
bool needQuotes = arg.find_first_of("\\\" \t\n") != std::string::npos;
|
bool needQuotes = arg.find_first_of("\\\" \t\n") != std::string::npos;
|
||||||
if (needQuotes)
|
if (needQuotes)
|
||||||
cmdLine += '"';
|
cmdLine += '"';
|
||||||
|
|
Loading…
Reference in New Issue