Skip to content
Snippets Groups Projects
Commit 12f15e4b authored by Kevin Bullock's avatar Kevin Bullock
Browse files

check-code: fix sed 'i' command rule newline matching

The regular expression was meant to match cases where an 'i' command was
not followed by precisely a '\' and then a newline; it failed to match
the newline, so cases with a '\' but no newline would erroneously pass.
parent 63dda3c3
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@
(r'/dev/u?random', "don't use entropy, use /dev/zero"),
(r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
(r'^( *)\t', "don't use tabs to indent"),
(r'sed .*\'(\d+|/[^/]*/)i[^\\][^\n]',
(r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
"put a backslash-escaped newline after sed 'i' command"),
],
# warnings
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment