[Mono-bugs] [Bug 80737][Nor] New - Path.GetFullPath returns wrong results if mixing "/" and "\"

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Feb 6 06:59:55 EST 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by frederik.carlier at ugent.be.


--- shadow/80737	2007-02-06 06:59:55.000000000 -0500
+++ shadow/80737.tmp.20395	2007-02-06 06:59:55.000000000 -0500
@@ -0,0 +1,60 @@
+Bug#: 80737
+Product: Mono: Class Libraries
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: Ubuntu
+Status: NEW   
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: frederik.carlier at ugent.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Path.GetFullPath returns wrong results if mixing "/" and "\"
+Description of Problem:
+If you combine two paths that contain that use "/" and "\" as directory
+seperators, System.IO.Path.GetFullPath will return incorrect results.
+Consider this code:
+string basePath = "/home/fcarlier/myproject/Properties";
+string relativePath = @"..\Resources\myfile.png";
+string combinedPath = Path.Combine(basePath, relativePath);
+string fullPath = Path.GetFullPath(combinedPath)
+On .NET, you get this result:
+On Mono (Linux), you get this result:
+i.e. the relative directory does not get correclty resolved.
+Please note that the intermediate result in Path.Combine indeed is correct!
+Steps to reproduce the problem:
+1. gmcs IOTest.cs
+2. mono IOTest.exe
+1. csc IOTest.cs
+2. IOTest.exe
+Actual Results:
+Expected Results:
+How often does this happen? 
+Additional Information:
+See the attached files, "IOTest.cs", "mono.out" and "net.out" for the
+source code, mono output on Linux and .NET output on Windows.

More information about the mono-bugs mailing list