Added quotation mark check in files::pathFromWindows (#77)

* Added quotation mark check in files::pathFromWindows

* Moved quotation mark logic to createprocess argument processing code
This commit is contained in:
Exant64 2024-07-23 09:29:47 +03:00 committed by GitHub
parent 701134e596
commit bcc6eae470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -226,6 +226,20 @@ namespace kernel32 {
// to prevent from doubling up on the target executable name // to prevent from doubling up on the target executable name
// (it appears as lpApplicationName, and as the first token in lpCommandLine) // (it appears as lpApplicationName, and as the first token in lpCommandLine)
arg = strtok(NULL, " "); arg = strtok(NULL, " ");
if (arg) {
// Trim all quotation marks from the start and the end of the string
while(*arg == '\"') {
arg++;
}
char* end = arg + strlen(arg) - 1;
while(end > arg && *end == '\"') {
*end = '\0';
end--;
}
}
argv[current_arg_index++] = arg; argv[current_arg_index++] = arg;
} }