From 98786d882525db4b506eddb011901c60d51857ac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 4 Mar 2023 17:16:16 +0300 Subject: =?UTF-8?q?fixes=20#3380=20(NewStory:=20=D0=BD=D0=B5=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=20=D0=BF=D0=B0=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D1=82=D1=81=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5?= =?UTF-8?q?=D0=BB=20=D0=B2=20=D0=BF=D1=83=D1=82=D0=B8=20=D0=BA=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D1=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_array.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 6247e22cab..6b64e08c63 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -129,6 +129,16 @@ void ItemData::load(bool bFullLoad) { CMStringW wszFileName(buf); wszFileName.Append(ptrW(DbEvent_GetTextW(&dbe, CP_ACP))); + + // if a filename contains spaces, URL will be broken + if (wszFileName.Find(' ') != -1) { + wchar_t wszShortPath[MAX_PATH]; + if (GetShortPathNameW(wszFileName, wszShortPath, _countof(wszShortPath))) { + wszFileName = wszShortPath; + wszFileName.MakeLower(); + } + } + wszFileName.Replace('\\', '/'); wszFileName.Insert(0, L"file://"); wtext = wszFileName.Detach(); -- cgit v1.2.3