From f1730691091bf110cdb6a71228c7d1e4d607a49d Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Tue, 10 Jan 2012 16:10:50 -0300 Subject: [PATCH] Stop using /(?=)/ since /.+/ is good enough. Originally, DiskstatsMenu differentiated between an empty pattern entered by the user (which in the shell version meant "match all") and any other valid pattern by replacing it with /(?=)/. However, Diskstats now carries the original string, inside the OptionParser object, so the above was redundant. --- lib/Diskstats.pm | 2 +- lib/DiskstatsMenu.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Diskstats.pm b/lib/Diskstats.pm index 22f4b64b..c51e0b26 100644 --- a/lib/Diskstats.pm +++ b/lib/Diskstats.pm @@ -45,7 +45,7 @@ sub new { # Defaults filename => '/proc/diskstats', column_regex => qr/cnc|rt|busy|prg|time|io_s/, - device_regex => qr/(?=)/, + device_regex => qr/.+/, block_size => 512, out_fh => \*STDOUT, filter_zeroed_rows => $o->get('zero-rows') ? undef : 1, diff --git a/lib/DiskstatsMenu.pm b/lib/DiskstatsMenu.pm index 13bc4151..d58e7941 100644 --- a/lib/DiskstatsMenu.pm +++ b/lib/DiskstatsMenu.pm @@ -413,7 +413,7 @@ sub get_new_regex_for { # somewhat magical, and basically just asking for trouble. # Instead we give them what awk would, a pattern that always # matches. - $args{options}->{current_group_by_obj}->$looking_for( qr/(?=)/ ); + $args{options}->{current_group_by_obj}->$looking_for( qr/.+/ ); $args{options}->{OptionParser}->set($looking_for_o, ''); } else {