diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-09-29 21:10:10 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-09-29 21:10:10 +0000 |
| commit | 795748846bf4dec200ae4bf05f0b4db113df6146 (patch) | |
| tree | 018bf5a7879fb650f45fd9897b2925467591a377 | |
| parent | * [INTL:IT] Translation re-synced (diff) | |
| download | inkscape-795748846bf4dec200ae4bf05f0b4db113df6146.tar.gz inkscape-795748846bf4dec200ae4bf05f0b4db113df6146.zip | |
Kludge for URI resolution of combining paths. Fixes bug #437927.
(bzr r8678)
| -rw-r--r-- | src/color-profile.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 9b05aaa7e..4b1307316 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -272,14 +272,17 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value ) // Normal for files that have not yet been saved. docbase = ""; } + + gchar* escaped = g_uri_escape_string(cprof->href, "!*'();:@=+$,/?#[]", TRUE); + //g_message("docbase:%s\n", docbase); org::w3c::dom::URI docUri(docbase); //# 2. Get href of icc file. we don't care if it's rel or abs - org::w3c::dom::URI hrefUri(cprof->href); + org::w3c::dom::URI hrefUri(escaped); //# 3. Resolve the href according the docBase. This follows // the w3c specs. All absolute and relative issues are considered org::w3c::dom::URI cprofUri = docUri.resolve(hrefUri); - gchar* fullname = g_strdup((gchar *)cprofUri.getNativePath().c_str()); + gchar* fullname = g_uri_unescape_string(cprofUri.getNativePath().c_str(), ""); cprof->_clearProfile(); cprof->profHandle = cmsOpenProfileFromFile( fullname, "r" ); if ( cprof->profHandle ) { @@ -289,6 +292,8 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value ) #ifdef DEBUG_LCMS DEBUG_MESSAGE( lcmsOne, "cmsOpenProfileFromFile( '%s'...) = %p", fullname, (void*)cprof->profHandle ); #endif // DEBUG_LCMS + g_free(escaped); + escaped = 0; g_free(fullname); #endif // ENABLE_LCMS } |
