[hackers] [sbase] ed: Don't match against line 0 in search() || Wolfgang Corcoran-Mathe

From: <git_AT_suckless.org>
Date: Tue, 27 Dec 2016 15:04:00 +0100 (CET)

commit f5baf2630ab0cf51306bb94311e7eed84caa730d
Author: Wolfgang Corcoran-Mathe <wcm_AT_sigwinch.xyz>
AuthorDate: Sun Jul 24 21:04:27 2016 -0400
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Dec 27 12:28:36 2016 +0100

    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

diff --git a/LICENSE b/LICENSE
index 6c0fc52..c86f70d 100644
--- a/LICENSE
+++ b/LICENSE
_AT_@ -58,6 +58,6 @@ Authors/contributors include:
 © 2015 Tai Chi Minh Ralph Eastwood <tcmreastwood_AT_gmail.com>
 © 2015 Quentin Rameau <quinq_AT_quinq.eu.org>
 © 2015 Dionysis Grigoropoulos <info_AT_erethon.com>
-© 2015 Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
+© 2015 Wolfgang Corcoran-Mathe <wcm_AT_sigwinch.xyz>
 © 2016 Mattias Andrée <maandree_AT_kth.se>
 © 2016 Eivind Uggedal <eivind_AT_uggedal.com>
diff --git a/ed.c b/ed.c
index 184ed30..0cf9fb9 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -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);
 
Received on Tue Dec 27 2016 - 15:04:00 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 27 2016 - 15:12:31 CET