[Mono-bugs] [Bug 42303][Nor] Changed - Path.GetFullPath () does not handle '.' and '..'

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 5 May 2003 12:13:56 -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 bmaurer@users.sf.net.


--- shadow/42303	Sun May  4 09:23:04 2003
+++ shadow/42303.tmp.20354	Mon May  5 12:13:56 2003
@@ -1,21 +1,22 @@
 Bug#: 42303
 Product: Mono/Class Libraries
 Version: unspecified
+OS: unknown
 OS Details: Red Hat 9 + libgc,mono,mcs up-to-date from cvs
 Status: NEW   
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gfr@skynet.be               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
+Cc: bmaurer@users.sf.net,gfr@skynet.be
 Summary: Path.GetFullPath () does not handle '.' and '..'
 Description of Problem:
 When we call the method Path.GetFullPath () with a path like
 '/somepath/./subpart/../././subpart/.' the result are different
@@ -102,6 +103,34 @@
 and '/dir/../dir/' become '/dir/'
 The test under MS runtime has been made with one 1.0 version
 Best regards to all
+------- Additional Comments From bmaurer@users.sf.net  2003-05-05 12:13 -------
+Looking at the GetFullPath () function, it looks like we make no 
+attempt to do this. Although I trust Microsoft is correct, is there a 
+place in the specs that says this (ECMA docs or MS docs)? If you 
+could try other functions and see if they also do similar path 
+I think I will write a function that would take path 
+like /a/b/c/../c2/ and make it /a/b/c2. There might be some code from 
+System.Uri that I could adapt for this use.
+Why don't you write up an NUnit test that tests the following paths
+/root/./ (. with slash)
+/root/. (dot w/o slash)
+/root/../ (. with slash)
+/root/.. (dot w/o slash)
+/root/../.. (what does Microsoft do here, on something like C:\..\..?)
+/root/.hiddenfile (dot, but not special meaning)
+/root/. / (note space)
+/root/.. / (note space)
+/root/..weirdname (two dots, no meaning)
+/root/.. (normal meaning)
+/root/../a/b/../../.. (order of processing)
+/root/./.. (two together)
+I can try to write a function to get everything working if I have the 
+NUnit tests.