summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/Slice/Util.cpp3
-rwxr-xr-xcpp/test/Slice/headers/run.py24
2 files changed, 25 insertions, 2 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index f8360f038c1..c3529e4bc13 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -154,8 +154,9 @@ Slice::fullPath(const string& path)
}
string
-Slice::changeInclude(const string& path, const vector<string>& includePaths)
+Slice::changeInclude(const string& p, const vector<string>& includePaths)
{
+ string path = normalizePath(p);
//
// Compare each include path against the included file and select
// the path that produces the shortest relative filename.
diff --git a/cpp/test/Slice/headers/run.py b/cpp/test/Slice/headers/run.py
index ba3af997e8b..12ba0d1d805 100755
--- a/cpp/test/Slice/headers/run.py
+++ b/cpp/test/Slice/headers/run.py
@@ -129,5 +129,27 @@ if not re.search(re.escape('#include <Ice/Identity.h>'), f.read()):
print("failed!")
sys.exit(1)
-print("ok")
+clean()
+
+#
+# symlink directory with extra / at end
+#
+#
+os.system("mkdir -p tmp/Ice-x.y.z/slice/Ice")
+os.system("mkdir -p tmp/Ice")
+os.system("cd tmp/Ice && ln -s ../Ice-x.y.z/slice/ .")
+f = open("tmp/Ice-x.y.z/slice/Ice/Identity.ice", "w")
+f.write("// dumy file")
+
+os.system("mkdir -p project1")
+f = open("project1/A.ice", "w")
+f.write("#include <Ice/Identity.ice>")
+f.close()
+os.system("cd project1 && %s -I%s/tmp/Ice/slice A.ice" % (slice2cpp, basedir))
+f = open("project1/A.h")
+if not re.search(re.escape('#include <Ice/Identity.h>'), f.read()):
+ print("failed!")
+ sys.exit(1)
clean()
+
+print("ok") \ No newline at end of file