[Mono-bugs] [Bug 42631][Cri] Changed - Path.GetFullPath adds duplicate drive ("c:\c:\") on win32
Thu, 8 May 2003 17:02:43 -0400 (EDT)
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 email@example.com.
--- shadow/42631 Thu May 8 16:05:38 2003
+++ shadow/42631.tmp.30728 Thu May 8 17:02:43 2003
@@ -3,20 +3,19 @@
OS Details: win 2000
Summary: Path.GetFullPath adds duplicate drive ("c:\c:\") on win32
Description of Problem:
Path.GetFullPath returns wrong result on win32 with paths containing drive
letter. The drive letter is duplicated e.g. "C:\" becomes "C:\C:\"
@@ -48,6 +47,57 @@
------- Additional Comments From firstname.lastname@example.org 2003-05-08 16:05 -------
Ups, the expected result should of course be:
+------- Additional Comments From email@example.com 2003-05-08 17:02 -------
+Yep, this would be my bug. I am going to copy an explaniation that I
+got via email from Gert Driesen
+In mono 0.24, when the C:\TestDirectory\TestFile.txt Windows path is
+to the Path.GetFullPath method, I get the following result :
+I saw that you have updated the Path class since the Mono 0.24
+I haven't been able to get Mono to build from cvs on Windows (grrrrr), but
+I'm sure the updates you did would still not correct this issue.
+Because, in the CanonicalizePath method, the root (in this case C:\)
+returned by the Path.GetDirectoryName (in this case C:\TestDirectory),
+will still be added twice to the return value, because it's also in
+if (target == 0)
+ return root + String.Join (DirectorySeparatorChar.ToString (),
+target) + DirectorySeparatorChar + file;
+ // which translates to :
+ "C:\" + // the root
+ "C:" + "\" + // result of
+String.Join on first element of dirs array
+ "TestDirectory" + "\" + // result of
+String.Join on second element of dirs array
+ "\" + // the
+DirectorySeparatorChar for Windows
+ "TestFile.txt"; // the
+which is C:\C:\TestDirectory\TestFile.txt !
+I think this is a big enough problem that we may want to refresh 0.24
+for Windows. I talked to Miguel about this, he said he might be able
+to do it tomorrow. However, testing _must_ be done first.