Skip to content

Commit 49dff5a

Browse files
PinkFreudgrooverdan
authored andcommitted
MDEV-34604 mytop - fix specifying filters in .mytop
Specifying filters (filter_status, filter_user, etc) in the mytop config previously wouldn't work, because any filter specified here was added to the config hash as a literal string. This change fixes that - if filter_* is defined in the config and matches an existing filter_* key, then run the value through StringOrRegex() and assign to the config hash.
1 parent 03a3503 commit 49dff5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/mytop.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ if (-e $config)
147147

148148
if (/(\S+)\s*=\s*(.*\S)/)
149149
{
150-
$config{lc $1} = $2 if exists $config{lc $1};
150+
my ($k, $v) = ($1, $2);
151+
if ($k =~ /^filter_/i) {
152+
$config{lc $k} = StringOrRegex($v) if exists $config{lc $k};
153+
} else {
154+
$config{lc $k} = $v if exists $config{lc $k};
155+
}
151156
}
152157
}
153158
close CFG;

0 commit comments

Comments
 (0)