Messages in this thread | | | Subject | Re: seq_putc is preferable to seq_puts | From | Joe Perches <> | Date | Fri, 18 May 2018 11:35:53 -0700 |
| |
On Fri, 2018-05-18 at 10:50 -0700, Joe Perches wrote: > and a trivial script to convert them all treewide > > $ git grep -P --name-only '\b(?:seq_puts|seq_printf)\s*\(\s*[^,]+,\s*"(?:\\.|.)"\s*\)\s*;' | \ > xargs perl -i -e 'local $/; while (<>) { s/\b(?:seq_puts|seq_printf)\s*\(\s*([^,]+),\s*"(\\.|.)"\s*\)\s*;/seq_putc(\1, '"'\2'"')/g; print;}'
Hmm, pity this was missing a trailing semicolon in the substitution
$ git grep -P --name-only '\b(?:seq_puts|seq_printf)\s*\(\s*[^,]+,\s*"(?:\\.|.)"\s*\)\s*;' | \ xargs perl -i -e 'local $/; while (<>) { s/\b(?:seq_puts|seq_printf)\s*\(\s*([^,]+),\s*"(\\.|.)"\s*\)\s*;/seq_putc(\1, '"'\2'"');/g; print;}'
| |