summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDave Reisner2012-03-20 09:44:40 +0100
committerKarel Zak2012-03-20 09:44:40 +0100
commit99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2 (patch)
tree3b0303acde572267b7ef28eddf8d0357de007585 /tools
parentfindmnt: add -P, --pairs to the man page (diff)
downloadkernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.tar.gz
kernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.tar.xz
kernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.zip
checkxalloc: nudge regex, fix newfound instances
Using the -w flag with grep actually fought against us here, and hid some instances where xalloc functions weren't used. Discard it in favor of an explicit word boundary as a prefix to the function name, and extend our requirements on the trailing side of the pattern. This also fixes the few new instances that were overlooked because of the regex's deficiency. [kzak@redhat.com: - fix also newfound in findmnt - remove unnecessary checks after xallocs] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkxalloc.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/checkxalloc.sh b/tools/checkxalloc.sh
index c507777db..3c342545f 100755
--- a/tools/checkxalloc.sh
+++ b/tools/checkxalloc.sh
@@ -10,7 +10,7 @@ cd "$(git rev-parse --show-toplevel)" || {
}
git grep -zl '#include "xalloc.h"' |
- xargs -0 grep -nwE '[^x](([cm]|re)alloc|strdup|asprintf)\('
+ xargs -0 grep -nE '\b(([cm]|re)alloc|strdup|asprintf)[[:space:]]*\([^)]'
result=$?