Only add CORE_LIBRARIES to TPA list if it is different from clrFilesAbsolutePath
authorEric Mellino <erme@microsoft.com>
Tue, 3 Jan 2017 19:22:13 +0000 (11:22 -0800)
committerEric Mellino <erme@microsoft.com>
Tue, 3 Jan 2017 19:22:13 +0000 (11:22 -0800)
This avoids placing duplicate entries on the TPA list.

Commit migrated from https://github.com/dotnet/coreclr/commit/f90e95606c8c335327c0729c16a90fbf5dddcfd1

src/coreclr/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp

index bedf7e3..723711e 100644 (file)
@@ -321,7 +321,10 @@ int ExecuteManagedAssembly(
     {
         nativeDllSearchDirs.append(":");
         nativeDllSearchDirs.append(coreLibraries);
-        AddFilesFromDirectoryToTpaList(coreLibraries, tpaList);
+        if (std::strcmp(coreLibraries, clrFilesAbsolutePath) != 0)
+        {
+            AddFilesFromDirectoryToTpaList(coreLibraries, tpaList);
+        }
     }
     nativeDllSearchDirs.append(":");
     nativeDllSearchDirs.append(clrFilesAbsolutePath);