Fix #407: Search all scanned segments for the key block footer

This commit is contained in:
Danny Moesch 2020-08-21 23:47:10 +02:00 committed by Mingshen Sun
parent 078503f249
commit 6ae506d7e6
2 changed files with 8 additions and 1 deletions

View file

@ -64,7 +64,7 @@ struct QRKeyScanner {
// Update the list of scanned segments and return.
segments.append(segment)
if segment.starts(with: keyType.footerStart), segment.hasSuffix(keyType.footerEnd) {
if scannedKey.contains(keyType.footerStart), scannedKey.hasSuffix(keyType.footerEnd) {
return .completed
}
previousResult = .scanned(segments.count)