X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b19d5e569e72a4c91708bba85c0b2268b28fe935..0bafad0cf468cdd3b035ec8eb33e30a4e93eee42:/src/html/helpdata.cpp 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; }