From ce3b33fa0f64ba8938ebe1482d0268f27921a0fc Mon Sep 17 00:00:00 2001 From: lxoliva Date: Fri, 22 Jan 2010 07:58:44 +0000 Subject: [PATCH] Deal with BOL and EOL when ^ and $ don't match in the middle of a string, in awk and in sed. Annotate generated sed script with hashbang. Fix unquoted whitespace. git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@5868 559672b5-ba27-0410-b829-e8f1faed8b1b --- deblob-check | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deblob-check b/deblob-check index 6d11c0c10f1..182ff82c1c2 100755 --- a/deblob-check +++ b/deblob-check @@ -2339,7 +2339,7 @@ set_except () { initnc 'static[ ]const[ ]u16[ ]rtl8225z2_rxgain\[\][ ]=' accept '[ ][ ][ ][ ][ ]\([ ]49,\)*[\n]\([ 0-9,]*[\n]\)*[ ][ ][ ][ ][ ]\( 49,\)*$' initnc 'static[ ]const[ ]unsigned[ ]char[ ]wm_vol\[256\][ ]=' - accept 'domain[ ][ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]10[ ]11[ ]12[ ]13[ ]14[ ]15[ ]16[ ]17[ ]18[ ]19[ ]20[ ]21[ ]22[ ]23[ ]24[ ]25[ ]26[ ]27[ ]28[ ]29[ ]30[ ]31[ ]32[ ]33[ ]34[ ]35 36$' + accept 'domain[ ][ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]10[ ]11[ ]12[ ]13[ ]14[ ]15[ ]16[ ]17[ ]18[ ]19[ ]20[ ]21[ ]22[ ]23[ ]24[ ]25[ ]26[ ]27[ ]28[ ]29[ ]30[ ]31[ ]32[ ]33[ ]34[ ]35[ ]36$' # drivers/net/e1000e/phy.c initnc 'static[ ]const[ ]u16[ ]e1000_igp_2_cable_length_table\[\][ ]=' accept '[ ]24[ ]=>[ ]\[[\n]\([^\n]*[\n]\)*[ ]\]\(,[ ][0-9]\+[ ]=> \[\)\?$' @@ -2533,9 +2533,11 @@ asmblob="[a-zA-Z_.][^\\n:;#/ ]*[ ]*:\\([^:{}]*\\|$asmcomment\\)*$blobseq\\([^:] set_sed_main () { falsepos=`sed -n 's,^[+]\^*,,p' < "$regex_name" | - sed -n "s,[$]$,$eol,; "'1h; 1!H; ${g;s,[\n],\\\\|,g;s,^\(..*\)$,\\\\(\1\\\\),;p;}'` + sed -n -e 's,[$]$,\\\\([\\\\n]\\\\|$\\\\),' \ + -e '1h; 1!H; ${g;s,[\n],\\\\|,g;s,^\(..*\)$,\\\\(\1\\\\),;p;}'` orfalseneg=`sed -n 's,^[-],,p' < "$regex_name" | - sed -n "s,[$]$,$eol,; "'1h; 1!H; ${g;s,\(^\|[\n]\),\\\\|,g;p;}'` + sed -n -e 's,[$]$,\\\\([\\\\n]\\\\|$\\\\),' \ + -e '1h; 1!H; ${g;s,\(^\|[\n]\),\\\\|,g;p;}'` case $orfalseneg in "") @@ -2575,6 +2577,8 @@ g fi $echo " +#! /bin/sed -f + /^$/N /^[\\n]\\?;[/][*]\\(end .*\\)\\?[*][/];$/{ $4 -- 2.31.1