summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Util.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2008-05-22 15:52:53 +0200
committerBenoit Foucher <benoit@zeroc.com>2008-06-06 12:25:26 +0200
commitfda44b9a7d2d2d2726d150c354348d2a9fce4e90 (patch)
tree8697d406ac0bdf5f6bdbfc35f1fe6f67b1823458 /cpp/src/Slice/Util.cpp
parentFixed IceGrid bug where a variable was used uninitialized (diff)
downloadice-fda44b9a7d2d2d2726d150c354348d2a9fce4e90.tar.bz2
ice-fda44b9a7d2d2d2726d150c354348d2a9fce4e90.tar.xz
ice-fda44b9a7d2d2d2726d150c354348d2a9fce4e90.zip
Fixed bug 3224 - Fixed more absolute path in slice2cpp generated headers
Diffstat (limited to 'cpp/src/Slice/Util.cpp')
-rw-r--r--cpp/src/Slice/Util.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index c9d19d80572..cdda7b7710f 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -49,9 +49,17 @@ normalizePath(const string& path)
++pos;
}
}
- if(result[result.size() - 1] == '/') // Remove trailing '/'
+
+ if(result.size() > 1) // Remove trailing "/" or "/."
{
- result.erase(result.size() - 1);
+ if(result[result.size() - 1] == '/')
+ {
+ result.erase(result.size() - 1);
+ }
+ else if(result[result.size() - 2] == '/' && result[result.size() - 1] == '.')
+ {
+ result.erase(result.size() - (result.size() == 2 ? 1 : 2));
+ }
}
return result;
}