Ævar Arnfjörð Bjarmason  <ava...@gmail.com> writes:

> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index d190469cd8..c1f52e457f 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -1561,13 +1561,13 @@ sub patch_update_file {
>                       elsif ($line =~ m|^/(.*)|) {
>                               my $regex = $1;
>                               unless ($other =~ m|/|) {
>                                       error_msg __("No other hunks to 
> search\n");
>                                       next;
>                               }
> -                             if ($1 eq "") {
> +                             if ($regex eq "") {
>                                       print colored $prompt_color, __("search 
> for regex? ");

Ah.  That "unless ... { }" thing is what was inserted recently, and
the patch is an obvious fix once the problem is pointed out.  Thanks
for a careful reading.

It makes me wonder what the original author, who already captured $1
in $regex, was thinking when he wrote the comparison with $1 there,
but that is OK---ithappend long time ago in early 2009.

Will apply.  Thanks.

>                                       $regex = <STDIN>;
>                                       if (defined $regex) {
>                                               chomp $regex;
>                                       }
>                               }

Reply via email to