Skip to content

Commit bcc6eae

Browse files
authored
Added quotation mark check in files::pathFromWindows (#77)
* Added quotation mark check in files::pathFromWindows * Moved quotation mark logic to createprocess argument processing code
1 parent 701134e commit bcc6eae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dll/kernel32.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,20 @@ namespace kernel32 {
226226
// to prevent from doubling up on the target executable name
227227
// (it appears as lpApplicationName, and as the first token in lpCommandLine)
228228
arg = strtok(NULL, " ");
229+
230+
if (arg) {
231+
// Trim all quotation marks from the start and the end of the string
232+
while(*arg == '\"') {
233+
arg++;
234+
}
235+
236+
char* end = arg + strlen(arg) - 1;
237+
while(end > arg && *end == '\"') {
238+
*end = '\0';
239+
end--;
240+
}
241+
}
242+
229243
argv[current_arg_index++] = arg;
230244
}
231245

0 commit comments

Comments
 (0)