Permalink
Browse files

Disable context when using -o/--output

  • Loading branch information...
hoelzro committed Mar 7, 2012
1 parent 9f88916 commit 95cd7e501bd5f42fc47c09306c98c73259d951e4
Showing with 3 additions and 0 deletions.
  1. +3 −0 Ack.pm
View
3 Ack.pm
@@ -686,6 +686,9 @@ sub iterate {
$is_iterating = 1;
+ local $opt->{before_context} = $opt->{output} ? 0 : $opt->{before_context};
+ local $opt->{after_context} = $opt->{output} ? 0 : $opt->{after_context};
+
my $n_before_ctx_lines = $opt->{before_context} || 0;
my $n_after_ctx_lines = $opt->{after_context} || 0;
my $current_line;

0 comments on commit 95cd7e5

Please sign in to comment.