Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/INIParser/INIParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public class INIParser {
/// - throws:
/// Exception
public init(string: String) throws {
let lines: [String] = string.split(separator: "\n").map { String($0) }
let lines: [String] = string.components(separatedBy: .newlines).compactMap{$0.isEmpty ? nil : $0}
var title: String? = nil
for line in lines {
if let content = try parse(line: line) {
Expand Down
4 changes: 2 additions & 2 deletions Tests/INIParserTests/INIParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class INIParserTests: XCTestCase {
freeVar1 = 1
freeVar2 = 2;
url = http://example.com/results?limit=10
[owner]
name = Rocky
[owner]\r
name = Rocky\r
organization = PerfectlySoft
;
[database]
Expand Down