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:
Jim Warner 2013-03-06 00:00:00 -06:00 committed by Jaromir Capik
parent ef99eebbdb
commit 1a50f39971

View File

@ -1347,11 +1347,11 @@ static inline int osel_matched (const WIN_t *q, FLG_t enu, const char *str) {
switch (osel->ops) {
case '<': // '<' needs the r < 0 unless
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;
case '>': // '>' needs the r > 0 unless
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;
default:
{ char *p = osel->sel(str, osel->val);