title: Bug in Directory.GetParent?
body: <p>I was hit in the face by a very weird behavior of the <code>System.IO.Directory.GetParent</code> method:</p>
  
  <pre><code>string path1 = @"C:\foo\bar";
  DirectoryInfo parent1 = Directory.GetParent(path1);
  Console.WriteLine (parent1.FullName); // Prints C:\foo, as expected
  
  // Notice the extra backslash. It should still refer to the same location, right ?
  string path2 = @"C:\foo\bar\";
  DirectoryInfo parent2 = Directory.GetParent(path2);
  Console.WriteLine (parent2.FullName); // Prints C:\foo\bar !!!
  </code></pre>
  
  <p>I would consider it a bug, but this method has been there since 1.0, so I guess it would have been detected by now. On the other hand, if it's as designed, I can't think of a sensible explanation for such a design...</p>
  
  <p>What do you think ? Is it a bug ? If not, how do you explain this behavior ?</p>