Skip to content

Commit

Permalink
coccinelle: fix verbose message about .cocci file being run
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Nicolas Palix <[email protected]>
  • Loading branch information
masahir0y committed Nov 14, 2017
1 parent e0be348 commit cd1af7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/coccicheck
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
Expand Down

0 comments on commit cd1af7c

Please sign in to comment.