From 29e60597389f16f9744a74bd4549b17d2e1dc34f Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 26 Jan 2000 00:49:52 +0000 Subject: [PATCH] some fixes in names of cached helpbooks (does not contain # or : anymore) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/helpdata.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index befee0b860..7c3616de5f 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -394,6 +394,17 @@ void wxHtmlHelpData::SetTempDir(const wxString& path) } + +static wxString SafeFileName(const wxString& s) +{ + wxString res(s); + res.Replace(wxT("#"), wxT("_")); + res.Replace(wxT(":"), wxT("_")); + res.Replace(wxT("\\"), wxT("_")); + res.Replace(wxT("/"), wxT("_")); + return res; +} + bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, wxFontEncoding encoding, const wxString& title, const wxString& contfile, @@ -446,7 +457,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, if (m_TempPath != wxEmptyString) { wxFileOutputStream *outs = new wxFileOutputStream(m_TempPath + - wxFileNameFromPath(bookfile.GetLocation()) + wxT(".cached")); + SafeFileName(wxFileNameFromPath(bookfile.GetLocation())) + wxT(".cached")); SaveCachedBook(bookr, outs); delete outs; } -- 2.45.2