From ccbc73ac933405c6238a3c803940f9b2bb0bfeb7 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Mon, 31 Dec 2018 23:29:58 +0300 Subject: [PATCH] [MPLAY32] Accept paths with double quotes from command-line (#1210) CORE-15525 --- base/applications/mplay32/mplay32.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/base/applications/mplay32/mplay32.c b/base/applications/mplay32/mplay32.c index e5299cb539f..2b70c1d0de6 100644 --- a/base/applications/mplay32/mplay32.c +++ b/base/applications/mplay32/mplay32.c @@ -12,6 +12,12 @@ #define MAIN_WINDOW_MIN_WIDTH 250 #define MAX_MCISTR 256 +#ifdef UNICODE +#define argv __wargv +#else +#define argv __argv +#endif + HINSTANCE hInstance = NULL; HWND hTrackBar = NULL; HWND hToolBar = NULL; @@ -1537,7 +1543,14 @@ _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdShow) ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); - OpenMediaFile(hwnd, lpCmdLine, NULL); + if (*lpCmdLine == _T('"')) + { + OpenMediaFile(hwnd, argv[1], NULL); + } + else + { + OpenMediaFile(hwnd, lpCmdLine, NULL); + } /* Message Loop */ while (GetMessage(&msg, NULL, 0, 0))