summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2008-05-09 10:40:09 -0400
committerBernard Normier <bernard@zeroc.com>2008-05-09 10:40:09 -0400
commit240f2fc68b04cd5637e16811bb350267410b30fb (patch)
treee5472cb7cf3808d14c33e22487cad02009fe1cba /cpp/src/Slice/Util.cpp
parentAdded missing service_running.png (diff)
parentBug 3119 - no local copy of dll for projects (diff)
downloadice-240f2fc68b04cd5637e16811bb350267410b30fb.tar.bz2
ice-240f2fc68b04cd5637e16811bb350267410b30fb.tar.xz
ice-240f2fc68b04cd5637e16811bb350267410b30fb.zip
Merge branch 'master' of cvs:/home/git/ice
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;
}