From dac83108394c64defea56570fb7964818d061ccf Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 4 Nov 2020 18:29:40 +0100 Subject: [PATCH] Avoid matching regular expressions from the script --- doc/scripts/fixme.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/scripts/fixme.sh b/doc/scripts/fixme.sh index 1db1787..04c1318 100755 --- a/doc/scripts/fixme.sh +++ b/doc/scripts/fixme.sh @@ -27,6 +27,8 @@ #variables PROGNAME="fixme.sh" PROJECTCONF="../project.conf" +REGEXP_ERROR="FIXME" +REGEXP_WARNING="\\(TODO\|XXX\\)" #executables DATE="date" DEBUG="_debug" @@ -99,9 +101,9 @@ _fixme_asm() filename="$1" #warnings - $GREP -nH '/\*.*\(TODO\|XXX\)' "$filename" + $GREP -nH "/\\*.*$REGEXP_WARNING" "$filename" #failures - $GREP -nH '/\*.*FIXME' "$filename" && res=2 + $GREP -nH "/\\*.*$REGEXP_ERROR" "$filename" && res=2 return $res } @@ -111,9 +113,9 @@ _fixme_c() filename="$1" #warnings - $GREP -nH '/\(/\|\*\).*\(TODO\|XXX\)' "$filename" + $GREP -nH "/\\(/\\|\\*\\).*$REGEXP_WARNING" "$filename" #failures - $GREP -nH '/\(/\|\*\).*FIXME' "$filename" && res=2 + $GREP -nH "/\\(/\\|\\*\\).*$REGEXP_ERROR" "$filename" && res=2 return $res } @@ -121,13 +123,12 @@ _fixme_sh() { res=0 filename="$1" - #XXX avoid matching the regexp comment="#" #warnings - $GREP -nH "$comment.*\\(TODO\\|XXX\\)" "$filename" + $GREP -nH "$comment.*$REGEXP_WARNING" "$filename" #failures - $GREP -nH "$comment.*FIXME" "$filename" && res=2 + $GREP -nH "$comment.*$REGEXP_ERROR" "$filename" && res=2 return $res } @@ -138,9 +139,9 @@ _fixme_xml() #XXX limited to a single line #warnings - $GREP -nH '