diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2007-03-29 22:51:30 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2007-03-29 22:51:30 +0000 |
| commit | 1ea514660c24a0497068675397a8d328348a1e3f (patch) | |
| tree | b555e41b2eb5aa8bcc8da750ac415fc14d5f4c5b /src/dom/uri.cpp | |
| parent | Begin to support IRI's (diff) | |
| download | inkscape-1ea514660c24a0497068675397a8d328348a1e3f.tar.gz inkscape-1ea514660c24a0497068675397a8d328348a1e3f.zip | |
Fix native path for iri
(bzr r2779)
Diffstat (limited to 'src/dom/uri.cpp')
| -rw-r--r-- | src/dom/uri.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index d2b8be66a..1747f42f9 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -263,26 +263,27 @@ DOMString URI::getPath() const DOMString URI::getNativePath() const { + DOMString pathStr = toStr(path); DOMString npath; #ifdef __WIN32__ unsigned int firstChar = 0; - if (path.size() >= 3) + if (pathStr.size() >= 3) { - if (path[0] == '/' && - isLetter(path[1]) && - path[2] == ':') + if (pathStr[0] == '/' && + isLetter(pathStr[1]) && + pathStr[2] == ':') firstChar++; } - for (unsigned int i=firstChar ; i<path.size() ; i++) + for (unsigned int i=firstChar ; i<pathStr.size() ; i++) { - XMLCh ch = (XMLCh) path[i]; + XMLCh ch = (XMLCh) pathStr[i]; if (ch == '/') npath.push_back((XMLCh)'\\'); else npath.push_back(ch); } #else - npath = path; + npath = pathStr; #endif return npath; } @@ -416,8 +417,8 @@ URI URI::resolve(const URI &other) const if (pos >= 0) { newUri.path.clear(); - //# append my path up to the / - for (int i = 0; i<pos+1 ; i++) + //# append my path up to and including the '/' + for (int i = 0; i<=pos ; i++) newUri.path.push_back(path[i]); //# append other path for (unsigned int i = 0; i<other.path.size() ; i++) |
