[PATCH 1/2] scripts/checkpatch.pl: allow special characters in spelling.txt
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Sun Dec 15 03:37:31 CET 2024
Checkpatch.pl uses the misspelled words from spelling.txt both as keys of a
hash and as part of a regular expression. For usage in the regular
expression special characters like the plus sign need to be escaped.
Escape special characters in the list of misspelled words.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b8eb57f38c7..cee60e390e7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -942,7 +942,7 @@ if ($codespell) {
}
}
-$misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix;
+$misspellings = join("|", map{quotemeta($_)} sort keys %spelling_fix) if keys %spelling_fix;
sub read_words {
my ($wordsRef, $file) = @_;
--
2.45.2
More information about the U-Boot
mailing list