From: Jonathan Pryor Date: Tue, 22 Nov 2011 15:58:49 +0000 (-0500) Subject: [mdoc-update] Filename comparison should be OrdinalIgnoreCase. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=084803d789f6d69e198d9c82264a92bad1b6d77b;p=mono.git [mdoc-update] Filename comparison should be OrdinalIgnoreCase. Consider the intermix of a case-sensitive language (C#) and a case-insensitive filesystem (OSX, Windows): namespace A { public class Foo {} } namespace a { public class Bar {} } On a case-sensitive filesystem, this will generate the structure: en/A/Foo.xml en/a/Bar.xml On a case-insensitive filesystem, we instead get: en/A/Foo.xml en/A/Bar.xml The problem with this is that CleanupFiles() uses filenames to index into the `goodfiles` HashSet`, and the filenames will contain e.g. "en/A/Bar.xml" for a.Bar, which won't exist in the HashSet, so it thus thinks the type doesn't exist and removes the file. This is obviously bad, but the fix is trivial: `goodfiles` should use an OrdinalIgnoreCase string comparison, as this is what the filesystem will be using on OS X and Windows. --- diff --git a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs index dee1da2c0a4..224d8d0d700 100644 --- a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs +++ b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs @@ -618,7 +618,7 @@ class MDocUpdater : MDocCommand index_assemblies.RemoveAll (); - HashSet goodfiles = new HashSet (); + HashSet goodfiles = new HashSet (StringComparer.OrdinalIgnoreCase); foreach (AssemblyDefinition assm in assemblies) { AddIndexAssembly (assm, index_assemblies);