[__line/state] Make sure the index match is at the beginning

Without the == 1 all lines which contain --line as a substring match.  e.g. if
--line is "line" and the file contains the line "wrong line" this was considered
a match.
This commit is contained in:
Dennis Camera 2020-01-15 17:39:21 +01:00
parent 629d0795c8
commit 4cdb8aaa03
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ function _find(_text, _pattern) {
if (needle == "regex") {
return match(_text, _pattern)
} else {
return index(_text, _pattern)
return index(_text, _pattern) == 1
}
}
BEGIN {