top: fine tune (ie. fix) 'other filter' negation logic
Two too many of these '=' (cooks) spoiled top's broth.
There exists an unintentional variation on the classic
error: off-by-one. When a negation symbol is used with
top's new relational 'other filter' provision, one too
many 'matches' are excluded. This happened because top
covered only 2 of the 3 potential strcmp return codes.
When the strings were equal, they were simply dropped.
So this patch will uninvent that particular variation!
(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)
Reference(s):
commit 2c2c5f5cd2
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
ef99eebbdb
commit
1a50f39971
@ -1347,11 +1347,11 @@ static inline int osel_matched (const WIN_t *q, FLG_t enu, const char *str) {
|
|||||||
switch (osel->ops) {
|
switch (osel->ops) {
|
||||||
case '<': // '<' needs the r < 0 unless
|
case '<': // '<' needs the r < 0 unless
|
||||||
r = osel->rel(str, osel->val); // '!' which needs an inverse
|
r = osel->rel(str, osel->val); // '!' which needs an inverse
|
||||||
if ((0 <= r && osel->flg) || (0 >= r && !osel->flg)) return 0;
|
if ((r >= 0 && osel->flg) || (r < 0 && !osel->flg)) return 0;
|
||||||
break;
|
break;
|
||||||
case '>': // '>' needs the r > 0 unless
|
case '>': // '>' needs the r > 0 unless
|
||||||
r = osel->rel(str, osel->val); // '!' which needs an inverse
|
r = osel->rel(str, osel->val); // '!' which needs an inverse
|
||||||
if ((0 >= r && osel->flg) || (0 <= r && !osel->flg)) return 0;
|
if ((r <= 0 && osel->flg) || (r > 0 && !osel->flg)) return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{ char *p = osel->sel(str, osel->val);
|
{ char *p = osel->sel(str, osel->val);
|
||||||
|
Loading…
Reference in New Issue
Block a user