Skip to content

Commit

Permalink
fix for GitHub issue 112. 'echo Foo|ack Bar' will now return 1 instea…
Browse files Browse the repository at this point in the history
…d of 0 (as indicated by the manpage, and as is consistent with ack's non-stdin based behavior)
  • Loading branch information
fallwith committed Feb 21, 2010
1 parent 9555698 commit 20d372e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ack
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ sub main {
App::Ack::warn( "Ignoring $nargs argument$s on the command-line while acting as a filter." );
}
my $res = App::Ack::Resource::Basic->new( '-' );
App::Ack::search_resource( $res, $opt );
my $nmatches = App::Ack::search_resource( $res, $opt );
$res->close();
exit 0;
$nmatches ? exit 0 : exit 1;
}

my $file_matching = $opt->{f} || $opt->{lines};
Expand Down
4 changes: 2 additions & 2 deletions ack-base
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ sub main {
App::Ack::warn( "Ignoring $nargs argument$s on the command-line while acting as a filter." );
}
my $res = App::Ack::Resource::Basic->new( '-' );
App::Ack::search_resource( $res, $opt );
my $nmatches = App::Ack::search_resource( $res, $opt );
$res->close();
exit 0;
$nmatches ? exit 0 : exit 1;
}

my $file_matching = $opt->{f} || $opt->{lines};
Expand Down
4 changes: 2 additions & 2 deletions btg/ack-standalone
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ sub main {
App::Ack::warn( "Ignoring $nargs argument$s on the command-line while acting as a filter." );
}
my $res = App::Ack::Resource::Basic->new( '-' );
App::Ack::search_resource( $res, $opt );
my $nmatches = App::Ack::search_resource( $res, $opt );
$res->close();
exit 0;
$nmatches ? exit 0 : exit 1;
}

my $file_matching = $opt->{f} || $opt->{lines};
Expand Down

1 comment on commit 20d372e

@petdance
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed on petdance/ack by another commit.

Please sign in to comment.