From 99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 20 Mar 2012 09:44:40 +0100 Subject: 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 Signed-off-by: Karel Zak --- tools/checkxalloc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') 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=$? -- cgit v1.2.3-55-g7522