[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [PATCH] guards: fix exit operator precedence error
From: |
Jean Delvare |
Subject: |
Re: [Quilt-dev] [PATCH] guards: fix exit operator precedence error |
Date: |
Mon, 10 Feb 2025 11:45:41 +0100 |
User-agent: |
Evolution 3.50.3 |
Hi Greg,
On Tue, 2025-01-21 at 09:45 +0100, Greg Kroah-Hartman wrote:
> The perl expression:
> exit $problems ? 1 : 0;
> will now throw a warning with newer versions of perl:
> Possible precedence issue with control flow operator (exit) at
> /usr/bin/guards line 198.
> as it properly catches that the control flow is NOT being evaluated
> here. For more details on the issue, please see this 10-year-old perl
> blog post:
>
> https://blogs.perl.org/users/buddy_burden/2014/06/when-a-failure-is-not-a-failure.html
>
> Fix this up by providing the proper "evaluate this expression and THEN
> return the value" logic that the code was expecting:
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> diff --git a/bin/guards.in b/bin/guards.in
> index 1c1605bbdbba..f6c4444bdf36 100644
> --- a/bin/guards.in
> +++ b/bin/guards.in
> @@ -195,7 +195,7 @@ if ($check) {
> # This is not an error if the entries are mutually exclusive...
> }
> }
> - exit $problems ? 1 : 0;
> + exit ($problems ? 1 : 0);
>
> } elsif ($list) {
> parse($fh, sub {
>
Applied, thanks.
I also fixed two similar issues in quilt/scripts/dependency-graph.in
and test/run.
--
Jean Delvare
SUSE L3 Support
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Quilt-dev] [PATCH] guards: fix exit operator precedence error,
Jean Delvare <=