diff mbox series

[WIP,02/30] scripts/coccicheck: modify to handle ${srctree} with trailing slash

Message ID 560cdde84d8bf9373db7a3d948d739d56f41e6e2.1709508290.git.ehem+linux@m5p.com (mailing list archive)
State New
Headers show
Series Adding trailing slash to $(*tree) | expand

Commit Message

Elliott Mitchell March 1, 2024, 11:50 p.m. UTC
These portions of the script would break if ${srctree} had a trailing
slash.  Since such a change is hoped for, ensure this script can handle
this situation.

Signed-off-by: Elliott Mitchell <ehem+linux@m5p.com>
---
An intermediate since for some versions need to handle both methods.
---
 scripts/coccicheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/coccicheck b/scripts/coccicheck
index e52cb43fede6..0395b6f943d4 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -210,7 +210,7 @@  coccinelle () {
 
     if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
 
-	FILE=${COCCI#$srctree/}
+	FILE=${COCCI#${srctree%/}/}
 
 	echo "Processing `basename $COCCI`"
 	echo "with option(s) \"$OPT\""