Skip to content

Commit a385c34

Browse files
committed
bug fixes
1 parent 1af8bc7 commit a385c34

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/AssemblyMetadata.Generators/AssemblyMetadataGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static GeneratorContext SemanticTransform(GeneratorAttributeSyntaxContex
5252
if (attribute.ConstructorArguments.Length == 1)
5353
{
5454
// remove Assembly
55-
if (name.StartsWith("Assembly"))
55+
if (name.Length > 8 && name.StartsWith("Assembly"))
5656
name = name.Substring(8);
5757

5858
// remove Attribute

src/AssemblyMetadata.Generators/AssemblyMetadataWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private static string SafeName(string name)
6161
private static string SafeValue(string value)
6262
{
6363
return value
64+
.Replace("\\", "\\\\")
6465
.Replace("\"", "\\\"")
6566
.Replace(Environment.NewLine, "\\r\\n");
6667
}

test/AssemblyMetadata.Generators.Tests/AssemblyMetadata.Generators.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PropertyGroup Label="Package">
1515
<Description>
1616
Source generator for project and assembly information
17-
as constants in the global "AssemblyMetadata" class
17+
as constants in the global "AssemblyMetadata" \ class
1818
</Description>
1919
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
2020
<Authors>LoreSoft</Authors>

0 commit comments

Comments
 (0)