mirror of
https://github.com/mpv-player/mpv
synced 2025-02-07 07:31:48 +00:00
win32-console-wrapper: remove command line mangling
This wasn't really necessary and caused a lot of problems.
This commit is contained in:
parent
8bfb20acdc
commit
c849f1aa23
@ -61,23 +61,14 @@ void cr_runproc(wchar_t *name, wchar_t *cmdline)
|
||||
|
||||
int wmain(int argc, wchar_t **argv, wchar_t **envp)
|
||||
{
|
||||
wchar_t *cmd, *args, *eargs;
|
||||
wchar_t *cmd;
|
||||
wchar_t exe[MAX_PATH];
|
||||
size_t len;
|
||||
|
||||
cmd = GetCommandLineW();
|
||||
args = cmd + wcslen(argv[0]);
|
||||
|
||||
GetModuleFileNameW(NULL, exe, MAX_PATH);
|
||||
wcscpy(wcsrchr(exe, '.') + 1, L"exe");
|
||||
|
||||
len = wcslen(exe) + wcslen(args) + 1;
|
||||
eargs = malloc(len * sizeof(wchar_t));
|
||||
swprintf(eargs, len, L"%s%s", exe, args);
|
||||
LocalFree(cmd);
|
||||
cr_runproc(exe, cmd);
|
||||
|
||||
cr_runproc(exe, eargs);
|
||||
|
||||
free(eargs);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user