Merge pull request #1245 from PowerShell/vors/types

Make DefineTypes aware of / as a path delimiter on non-windows systems
This commit is contained in:
Sergei Vorobev authored and GitHub committed 2016-06-30 10:29:43 -07:00
commit 75ee763d32
1 file changed
+4 -1
@@ -1124,7 +1124,10 @@ namespace System.Management.Automation.Language
// Two replaces at the end are for not-allowed characters. They are replaced by similar-looking chars.
string assemblyName = ClrFacade.FIRST_CHAR_PSASSEMBLY_MARK + (string.IsNullOrWhiteSpace(rootAst.Extent.File)
? "powershell"
: rootAst.Extent.File.Replace('\\', (char)0x29f9).Replace(':', (char)0x0589));
: rootAst.Extent.File
.Replace('\\', (char)0x29f9)
.Replace('/', (char)0x29f9)
.Replace(':', (char)0x0589));
var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(assemblyName),
AssemblyBuilderAccess.RunAndCollect, GetAssemblyAttributeBuilders());