mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix bug in SAXEqualTags.
This commit is contained in:
@@ -103,6 +103,7 @@ extension OPMLParser: SAXParserDelegate {
|
||||
if let item = currentItem as? OPMLDocument {
|
||||
item.title = saxParser.currentStringWithTrimmedWhitespace
|
||||
}
|
||||
saxParser.endStoringCharacters()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public final class SAXParser {
|
||||
characters.count = 0
|
||||
}
|
||||
|
||||
func endStoringCharacters() {
|
||||
public func endStoringCharacters() {
|
||||
|
||||
storingCharacters = false
|
||||
characters.count = 0
|
||||
|
||||
@@ -12,9 +12,9 @@ public func SAXEqualTags(_ localName: XMLPointer, _ tag: ContiguousArray<Int8>)
|
||||
|
||||
return tag.withUnsafeBufferPointer { bufferPointer in
|
||||
|
||||
let tagCount = tag.count
|
||||
let tagCount = tag.count // includes 0 terminator
|
||||
|
||||
for i in 0..<tagCount {
|
||||
for i in 0..<tagCount - 1 {
|
||||
|
||||
let localNameCharacter = localName[i]
|
||||
if localNameCharacter == 0 {
|
||||
@@ -28,6 +28,6 @@ public func SAXEqualTags(_ localName: XMLPointer, _ tag: ContiguousArray<Int8>)
|
||||
}
|
||||
|
||||
// localName might actually be longer — make sure it’s the same length as tag.
|
||||
return localName[tagCount] == 0
|
||||
return localName[tagCount - 1] == 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user