[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.

http://bugzilla.ximian.com/show_bug.cgi?id=80737

--- 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   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: frederik.carlier at ugent.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+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:
+C:\home\fcarlier\myproject\Resources\myfile.png
+
+On Mono (Linux), you get this result:
+/home/fcarlier/myproject/Properties/..\Resources\myfile.png
+
+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:
+Linux:
+1. gmcs IOTest.cs
+2. mono IOTest.exe
+
+Windows:
+1. csc IOTest.cs
+2. IOTest.exe
+
+Actual Results:
+/home/fcarlier/myproject/Properties/..\Resources\myfile.png
+
+Expected Results:
+C:\home\fcarlier\myproject\Resources\myfile.png
+
+How often does this happen? 
+Always
+
+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