If a file has no SPDX tag and is not filtered out by no_license_list,
there will be an error when using its path containing a slash
in the sed command delimited with slashes.

It is fixed by using the pipe character as sed command delimiter.

Fixes: b99a3b8aa989 ("license: standardize SPDX tag")
Cc: [email protected]

Reported-by: David Marchand <[email protected]>
Signed-off-by: Thomas Monjalon <[email protected]>
---
 devtools/check-spdx-tag.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/check-spdx-tag.sh b/devtools/check-spdx-tag.sh
index 2390941c74..f0fcddf0d3 100755
--- a/devtools/check-spdx-tag.sh
+++ b/devtools/check-spdx-tag.sh
@@ -41,7 +41,7 @@ check_spdx() {
     files_without_spdx=$(cat $tmpfile)
     git grep -LE '(/\*|#|;|\.\.) *SPDX-License-Identifier: [A-Z(]' -- 
$no_license_list > $tmpfile
     for file in $files_without_spdx ; do
-       sed -i "/^$file$/d" $tmpfile
+       sed -i "\|^$file$|d" $tmpfile
     done
 
     warnings=$(($warnings + $(wc -l < $tmpfile)))
-- 
2.53.0

Reply via email to