X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=build-aux%2Fuseless-if-before-free;fp=build-aux%2Fuseless-if-before-free;h=9325d075323cbcd16738f9d0dc64d1635e6b3730;hb=a8a88eddaa90432e6ec1b8d9d5c9842bc91afd1d;hp=1899b1ffd82f1c3a0ac7cadc87fac7a6523d6675;hpb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;p=debian%2Fgzip
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 1899b1f..9325d07 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -4,13 +4,13 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
# Detect instances of "if (p) free (p);".
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
-my $VERSION = '2016-01-12 23:13'; # UTC
+my $VERSION = '2017-09-13 06:45'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2018 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@ my $VERSION = '2016-01-12 23:13'; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
# Written by Jim Meyering
@@ -33,7 +33,7 @@ use Getopt::Long;
(my $ME = $0) =~ s|.*/||;
-# use File::Coda; # http://meyering.net/code/Coda/
+# use File::Coda; # https://meyering.net/code/Coda/
END {
defined fileno STDOUT or return;
close STDOUT and return;
@@ -129,6 +129,9 @@ sub is_NULL ($)
$err = EXIT_ERROR, next;
while (defined (my $line = ))
{
+ # Skip non-matching lines early to save time
+ $line =~ /\bif\b/
+ or next;
while ($line =~
/\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
# 1 2 3