nimgrep: fixes #989
This commit is contained in:
parent
2ccc9db59d
commit
bd5dd2b95b
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue