mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
nimgrep: fixes #989
This commit is contained in:
@@ -160,7 +160,7 @@ proc processFile(pattern; filename: string; counter: var int) =
|
||||
var reallyReplace = true
|
||||
while i < buffer.len:
|
||||
let t = findBounds(buffer, pattern, matches, i)
|
||||
if t.first < 0: break
|
||||
if t.first < 0 or t.last < t.first: break
|
||||
inc(line, countLines(buffer, i, t.first-1))
|
||||
|
||||
var wholeMatch = buffer.substr(t.first, t.last)
|
||||
|
||||
Reference in New Issue
Block a user