summaryrefslogtreecommitdiff
path: root/build-aux/useless-if-before-free
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/useless-if-before-free')
-rwxr-xr-xbuild-aux/useless-if-before-free7
1 files changed, 5 insertions, 2 deletions
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 1899b1f..4e3f3a2 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 = '2016-08-01 17:47'; # 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-2017 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
@@ -129,6 +129,9 @@ sub is_NULL ($)
$err = EXIT_ERROR, next;
while (defined (my $line = <FH>))
{
+ # 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