mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
search: skip a match on the magic line, as it is a just convenience line
As the magic line isn't really a line (it is not counted in the number of lines read and written), and nothing is on it (not even a newline), it doesn't make sense to allow any regex, like ^ or $, to match it. This fixes https://savannah.gnu.org/bugs/?63034. Indirectly-reported-by: Mike Scalora <mike@scalora.org> Bug existed since before version 2.0.0.
This commit is contained in:
parent
567310e698
commit
50954a4b6a
@ -222,8 +222,9 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
/* The match is valid. */
|
||||
break;
|
||||
/* When not on the magic line, the match is valid. */
|
||||
if (line->next || line->data[0])
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
|
Loading…
Reference in New Issue
Block a user