mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
1 parent
991a940412
commit
c08cb1dc9a
5 files changed
+99
-2
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user