summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-04-07 13:48:16 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-04-07 13:48:16 -0230
commit058f51cd8674760cac8b7c0b04afa5915af9f667 (patch)
treef7c9f6039aa2795222e7dbfc0a7babab13e2dee9 /cpp/src
parentupdating CHANGES for bug 3739 (diff)
downloadice-058f51cd8674760cac8b7c0b04afa5915af9f667.tar.bz2
ice-058f51cd8674760cac8b7c0b04afa5915af9f667.tar.xz
ice-058f51cd8674760cac8b7c0b04afa5915af9f667.zip
Bug 3832 - slice conmpiler issues with UNC paths
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp13
-rw-r--r--cpp/src/Slice/Util.cpp4
2 files changed, 15 insertions, 2 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 29c968f9f93..ca2c2827dc6 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -89,8 +89,19 @@ Slice::Preprocessor::normalizeIncludePath(const string& path)
replace(result.begin(), result.end(), '\\', '/');
+ string::size_type startReplace = 0;
+#ifdef _WIN32
+ //
+ // For UNC paths we need to ensure they are in the format that is
+ // used by MCPP. IE. "//MACHINE/PATH"
+ //
+ if(result.find("//") == 0)
+ {
+ startReplace = 2;
+ }
+#endif
string::size_type pos;
- while((pos = result.find("//")) != string::npos)
+ while((pos = result.find("//", startReplace)) != string::npos)
{
result.replace(pos, 2, "/");
}
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index dffbef6523b..916bebbea03 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -26,8 +26,9 @@ static string
normalizePath(const string& path)
{
string result = path;
+
replace(result.begin(), result.end(), '\\', '/');
- string::size_type pos;
+
string::size_type startReplace = 0;
#ifdef _WIN32
//
@@ -39,6 +40,7 @@ normalizePath(const string& path)
startReplace = 2;
}
#endif
+ string::size_type pos;
while((pos = result.find("//", startReplace)) != string::npos)
{
result.replace(pos, 2, "/");