aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-01-29 18:23:43 +0000
committerJim Meyering <meyering@redhat.com>2008-01-29 18:23:43 +0000
commit2367caa32720708dd012332740873572b44ccafb (patch)
tree0d8e4e707798587e8f64105913b69b068d984259 /build-aux
parentEnable two more tests. (diff)
downloadlibvirt-2367caa32720708dd012332740873572b44ccafb.tar.gz
libvirt-2367caa32720708dd012332740873572b44ccafb.tar.bz2
libvirt-2367caa32720708dd012332740873572b44ccafb.zip
Also detect and remove unnecessary if-before-xmlXPathFreeContext.
* build-aux/find-unnecessary-if-before-free: Update regexp. * src/openvz_conf.c: Remove unnecessary "if (P)"-before xmlXPathFreeContext. * src/qemu_conf.c: Likewise. * src/virsh.c: Likewise. * src/xm_internal.c: Likewise. * src/xml.c: Likewise. * tests/xmlrpctest.c: Likewise.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/find-unnecessary-if-before-free6
1 files changed, 3 insertions, 3 deletions
diff --git a/build-aux/find-unnecessary-if-before-free b/build-aux/find-unnecessary-if-before-free
index a95ac2460..0cd38ebc1 100755
--- a/build-aux/find-unnecessary-if-before-free
+++ b/build-aux/find-unnecessary-if-before-free
@@ -22,7 +22,7 @@ use warnings;
{
if ($line =~
/\b(if\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)
- \s+(?:sexpr_)?free\s*\(\s*\2\s*\))/sx)
+ \s+(?:xmlXPathFreeContext|(?:sexpr_)?free)\s*\(\s*\2\s*\))/sx)
{
print "$file: $1\n";
$found_match = 1;
@@ -37,6 +37,6 @@ my $foo = <<'EOF';
# The above is to *find* them.
# This adjusts them, removing the unnecessary "if (p)" part.
-git ls-files -z |xargs -0 \
-perl -0x3b -pi -e 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+((?:sexpr_)?free\s*\(\s*\1\s*\))/$2/s'
+git ls-files -z --exclude=find-unnecessary-if-before-free |xargs -0 \
+perl -0x3b -pi -e 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+((?:xmlXPathFreeContext|(?:sexpr_)?free)\s*\(\s*\1\s*\))/$2/s'
EOF