Skip to content

Commit 4b545be

Browse files
committed
Escape filename backslashes when generating Manifest DOT graph.
1 parent 301bb25 commit 4b545be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/LLBuildManifest/DOTManifestSerializer.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ public struct DOTManifestSerializer {
3232
return label
3333
}
3434

35-
/// Quote the name and escape the quotes
35+
/// Quote the name and escape the quotes and backslashes
3636
func quoteName(_ name: String) -> String {
37-
return "\"" + name.replacingOccurrences(of: "\"", with: "\\\"") + "\""
37+
return "\"" + name.replacingOccurrences(of: "\"", with: "\\\"")
38+
.replacingOccurrences(of: "\\", with: "\\\\") + "\""
3839
}
3940

4041
public mutating func writeDOT<Stream: TextOutputStream>(to stream: inout Stream) {

0 commit comments

Comments
 (0)