From: Masahiro Yamada Date: Thu, 26 Oct 2017 04:55:51 +0000 (+0900) Subject: coccinelle: fix verbose message about .cocci file being run X-Git-Tag: v4.15-rc1~49^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd1af7cfbbdc7719b74ad9f3c88e50bb77713664;p=thirdparty%2Fkernel%2Flinux.git coccinelle: fix verbose message about .cocci file being run If you run coccicheck with V=1 and COCCI=, you will see a strange path to the semantic patch file. For example, run the following: $ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck [ snip ] The semantic patch that makes this report is available in scriptcoccinelle/free/kfree.cocci. Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci". When running coccicheck without O=, $srctree is expanded to ".", which represents one arbitrary character in the regular expression. Using sed is not a good choice here. Strip $srctree/ simply without sed. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Palix --- diff --git a/scripts/coccicheck b/scripts/coccicheck index 97f28f0f9498f..41a85b1ed35e3 100755 --- a/scripts/coccicheck +++ b/scripts/coccicheck @@ -186,7 +186,7 @@ coccinelle () { if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then - FILE=`echo $COCCI | sed "s|$srctree/||"` + FILE=${COCCI#$srctree/} echo "Processing `basename $COCCI`" echo "with option(s) \"$OPT\""