From ec2c85bf79778212bfcbc849e0a69c1c59bafc90 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Oct 2010 14:10:05 +0000 Subject: [PATCH] Construct paths using wxFileName in wxHTML help. Use wxFileName instead of more complicated and error-prone manipulations with strings. Closes #12602. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/helpdata.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index f67b1689c8..edebdcc7fb 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -475,11 +475,10 @@ void wxHtmlHelpData::SetTempDir(const wxString& path) m_tempPath = path; else { - if (wxIsAbsolutePath(path)) m_tempPath = path; - else m_tempPath = wxGetCwd() + wxT("/") + path; + wxFileName fn(path); + fn.MakeAbsolute(); - if (m_tempPath[m_tempPath.length() - 1] != wxT('/')) - m_tempPath << wxT('/'); + m_tempPath = fn.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR); } }