- if (m_path[0u] != wxT('/'))
- {
- //Merge paths
- wxString::const_iterator op = m_path.begin();
- wxString::const_iterator bp = base.m_path.begin() + base.m_path.length();
-
- //not a ending directory? move up
- if (base.m_path[0] && *(bp-1) != wxT('/'))
- UpTree(base.m_path.begin(), bp);
-
- //normalize directories
- while(*op == wxT('.') && *(op+1) == wxT('.') &&
- (*(op+2) == '\0' || *(op+2) == wxT('/')) )
- {
- UpTree(base.m_path.begin(), bp);
-
- if (*(op+2) == '\0')
- op += 2;
- else
- op += 3;
- }
-
- m_path = base.m_path.substr(0, bp - base.m_path.begin()) +
- m_path.substr((op - m_path.begin()), m_path.length());
- }
- }
-
- //T.fragment = R.fragment;
-}
-
-// ---------------------------------------------------------------------------
-// UpTree
-//
-// Moves a URI path up a directory
-// ---------------------------------------------------------------------------
-
-//static
-void wxURI::UpTree(wxString::const_iterator uristart,
- wxString::const_iterator& uri)
-{
- if (uri != uristart && *(uri-1) == wxT('/'))
- {
- uri -= 2;
- }
-
- for(;uri != uristart; --uri)
- {
- if (*uri == wxT('/'))
- {
- ++uri;
- break;
- }
- }