Prevent foot-shooting in advance: Put the MATCH() macro's value
in parentheses. The ?: operator has a remarkably low precedence, so expressions like (MATCH(foo) && bar) would have an unexpected meaning w/o the parentheses around MATCH(). Tested with: md5(1)
This commit is contained in:
parent
ff7499570c
commit
b1b46280cb
@ -264,9 +264,9 @@ new: if (!nflag && !pd)
|
||||
* TRUE if the address passed matches the current program state
|
||||
* (lastline, linenumber, ps).
|
||||
*/
|
||||
#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()
|
||||
#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())
|
||||
|
||||
/*
|
||||
* Return TRUE if the command applies to the current line. Sets the inrange
|
||||
|
Loading…
Reference in New Issue
Block a user