File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -809,7 +809,6 @@ sub print_line_with_context {
809
809
}
810
810
811
811
my $ors = $opt_print0 ? " \0 " : " \n " ;
812
- my $match_word = $opt -> {w };
813
812
my $is_tracking_context = $opt_after_context || $opt_before_context ;
814
813
815
814
$matching_line =~ s / [\r\n ]+$// g ;
@@ -929,10 +928,9 @@ sub resource_has_match {
929
928
}
930
929
}
931
930
else {
932
- my $re = $opt_regex ;
933
931
if ( $opt_v ) {
934
932
while ( <$fh > ) {
935
- if (!/$re /o) {
933
+ if (!/$opt_regex /o) {
936
934
$has_match = 1;
937
935
last ;
938
936
}
@@ -945,7 +943,7 @@ sub resource_has_match {
945
943
local $/ ;
946
944
<$fh >;
947
945
};
948
- $has_match = $content =~ / $re /o ;
946
+ $has_match = $content =~ / $opt_regex /o ;
949
947
}
950
948
close $fh ;
951
949
}
@@ -964,18 +962,17 @@ sub count_matches_in_resource {
964
962
}
965
963
}
966
964
else {
967
- my $re = $opt_regex ;
968
965
if ( $opt_v ) {
969
966
while ( <$fh > ) {
970
- ++$nmatches if (!/$re /o);
967
+ ++$nmatches if (!/$opt_regex /o);
971
968
}
972
969
}
973
970
else {
974
971
my $content = do {
975
972
local $/ ;
976
973
<$fh >;
977
974
};
978
- $nmatches =()= ($content =~ / $re /og );
975
+ $nmatches =()= ($content =~ / $opt_regex /og );
979
976
}
980
977
close $fh ;
981
978
}
@@ -1114,8 +1111,6 @@ RESOURCES:
1114
1111
last RESOURCES if defined ($opt_m ) && $nmatches >= $opt_m ;
1115
1112
}
1116
1113
elsif ( $opt_lines ) {
1117
- my $opt_passthru = $opt_passthru ;
1118
-
1119
1114
my %line_numbers ;
1120
1115
foreach my $line ( @{ $opt_lines } ) {
1121
1116
my @lines = split /,/, $line ;
You can’t perform that action at this time.
0 commit comments