summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed/process.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-07-03 14:38:27 +0000
committertjr <tjr@FreeBSD.org>2002-07-03 14:38:27 +0000
commit110c2de07c405176de37d5a49c2173d05a37ae84 (patch)
tree0e9ba14e2435a6c3a79c7799f5cbca8f4bf3554e /usr.bin/sed/process.c
parentf71af381af338a718b4808374ec0fa5be8193bc3 (diff)
downloadFreeBSD-src-110c2de07c405176de37d5a49c2173d05a37ae84.zip
FreeBSD-src-110c2de07c405176de37d5a49c2173d05a37ae84.tar.gz
Avoid checking whether each line is the last line of the file when we don't
need to know. Instead, check when we are trying to match a "$" address. This does not change the way sed processes regular files, but makes it behave more sensibly when used interactively. PR: 40101 MFC after: 2 weeks
Diffstat (limited to 'usr.bin/sed/process.c')
-rw-r--r--usr.bin/sed/process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index b2cfbc7..0b24f12 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -270,7 +270,7 @@ new: if (!nflag && !pd)
*/
#define MATCH(a) \
(a)->type == AT_RE ? regexec_e((a)->u.r, ps, 0, 1, psl) : \
- (a)->type == AT_LINE ? linenum == (a)->u.l : lastline
+ (a)->type == AT_LINE ? linenum == (a)->u.l : lastline()
/*
* Return TRUE if the command applies to the current line. Sets the inrange
OpenPOWER on IntegriCloud