From 084803d789f6d69e198d9c82264a92bad1b6d77b Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Tue, 22 Nov 2011 10:58:49 -0500 Subject: [PATCH] [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. --- mcs/tools/mdoc/Mono.Documentation/monodocer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.25.1