summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/RubyUtil.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2008-04-21 17:58:38 +0200
committerBenoit Foucher <benoit@zeroc.com>2008-04-21 17:58:38 +0200
commit094286e06f0ff154f20fcccce0c71068a3d216d5 (patch)
tree606797928608baa057fe9a9ea096622e0eb37930 /cpp/src/Slice/RubyUtil.cpp
parentFixed potential IceUtil::NullHandleException (diff)
downloadice-094286e06f0ff154f20fcccce0c71068a3d216d5.tar.bz2
ice-094286e06f0ff154f20fcccce0c71068a3d216d5.tar.xz
ice-094286e06f0ff154f20fcccce0c71068a3d216d5.zip
Fixed bug 3011
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r--cpp/src/Slice/RubyUtil.cpp46
1 files changed, 1 insertions, 45 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 2f861a8e283..de38a9a15bd 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1600,46 +1600,6 @@ Slice::Ruby::CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberI
}
}
-static string
-changeInclude(const string& inc, const vector<string>& includePaths)
-{
- string orig = normalizePath(inc);
- string curr = orig; // The current shortest pathname.
- string cwd = getCwd();
-
- //
- // Compare the pathname of the included file against each of the include directories.
- // If any of the include directories match the leading part of the included file,
- // then select the include directory whose removal results in the shortest pathname.
- //
- for(vector<string>::const_iterator p = includePaths.begin(); p != includePaths.end(); ++p)
- {
- string includePath = *p;
- if(isAbsolute(orig) && !isAbsolute(includePath))
- {
- includePath = cwd + "/" + includePath;
- }
- includePath = normalizePath(includePath);
-
- if(orig.compare(0, includePath.size(), includePath) == 0)
- {
- string s = orig.substr(includePath.size());
- if(s.size() < curr.size())
- {
- curr = s;
- }
- }
- }
-
- string::size_type pos = curr.rfind('.');
- if(pos != string::npos)
- {
- curr.erase(pos);
- }
-
- return curr;
-}
-
void
Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out)
{
@@ -1650,11 +1610,7 @@ Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<s
vector<string> paths = includePaths;
for(vector<string>::iterator p = paths.begin(); p != paths.end(); ++p)
{
- if(p->size() && (*p)[p->size() - 1] != '/')
- {
- *p += '/';
- }
- *p = normalizePath(*p);
+ *p = fullPath(*p);
}
StringList includes = un->includeFiles();