summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2008-05-07 11:18:53 +0200
committerBenoit Foucher <benoit@zeroc.com>2008-05-07 11:18:53 +0200
commit9ba24d1a740d226acbb78dd69b6dc978c0a63b0e (patch)
treef4179b93bccfaf63064587351b5000659f27171b /cpp/src/Slice/Util.cpp
parenthttp://bugzilla/bugzilla/show_bug.cgi?id=3093 -- IceBox/configuration test sh... (diff)
downloadice-9ba24d1a740d226acbb78dd69b6dc978c0a63b0e.tar.bz2
ice-9ba24d1a740d226acbb78dd69b6dc978c0a63b0e.tar.xz
ice-9ba24d1a740d226acbb78dd69b6dc978c0a63b0e.zip
Fixed bug 3084
Diffstat (limited to 'cpp/src/Slice/Util.cpp')
-rw-r--r--cpp/src/Slice/Util.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index 4d6be4e1834..c9d19d80572 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -93,6 +93,7 @@ Slice::fullPath(const string& path)
result = string(cwdbuf) + '/' + result;
}
}
+
result = normalizePath(result);
string::size_type beg = 0;
@@ -115,7 +116,14 @@ Slice::fullPath(const string& path)
if(len > 0)
{
buf[len] = '\0';
- result = normalizePath(buf) + (next != string::npos ? result.substr(next) : string());
+ string linkpath = buf;
+ if(!isAbsolute(linkpath)) // Path relative to the location of the link
+ {
+ string::size_type pos = subpath.rfind('/');
+ assert(pos != string::npos);
+ linkpath = subpath.substr(0, pos + 1) + linkpath;
+ }
+ result = normalizePath(linkpath) + (next != string::npos ? result.substr(next) : string());
beg = 0;
next = 0;
}