Fix decoded line allowlist (#1788)

* fix

* B patch

* buh bye
This commit is contained in:
Zachary Rice authored and GitHub committed 2025-03-12 20:16:16 -05:00
1 parent 991a940412
commit c08cb1dc9a
5 files changed
+99 -2

No files matched your search

+22
View File
@@ -279,3 +279,25 @@ func segmentWithDecodedOverlap(encodedSegments []EncodedSegment, start, end int)
return nil
}
func (s EncodedSegment) lineStartIndex(currentRaw string) int {
for i := s.decodedStart; i > -1; i-- {
c := currentRaw[i]
if c == '\n' {
return i
}
}
return 0
}
func (s EncodedSegment) lineEndIndex(currentRaw string, matchLen int) int {
for i := s.decodedStart; i < s.decodedStart+matchLen; i++ {
c := currentRaw[i]
if c == '\n' {
return i
}
}
return len(currentRaw) - 1
}