ed: Don't match against line 0 in search()

regexec(3) happily matches /^$/ against the text of line
zero (the null string), causing an error.

Also update email address for Wolfgang Corcoran-Mathe
This commit is contained in:
Wolfgang Corcoran-Mathe 2016-07-24 21:04:27 -04:00 committed by Laslo Hunhold
parent 28129a87c4
commit f5baf2630a
2 changed files with 2 additions and 2 deletions

View File

@ -58,6 +58,6 @@ Authors/contributors include:
© 2015 Tai Chi Minh Ralph Eastwood <tcmreastwood@gmail.com>
© 2015 Quentin Rameau <quinq@quinq.eu.org>
© 2015 Dionysis Grigoropoulos <info@erethon.com>
© 2015 Wolfgang Corcoran-Mathe <first.lord.of.teal@gmail.com>
© 2015 Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
© 2016 Mattias Andrée <maandree@kth.se>
© 2016 Eivind Uggedal <eivind@uggedal.com>

2
ed.c
View File

@ -426,7 +426,7 @@ search(int way)
i = curln;
do {
i = (way == '?') ? prevln(i) : nextln(i);
if (match(i))
if (i > 0 && match(i))
return i;
} while (i != curln);