Re: [PATCH 2/4] Mechanical conversion to use prefixcmp()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 20, 2007, 11:53 UTC
- Message-ID
- <Pine.LNX.4.63.0702201243000.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7v3b51xihy.fsf_-_@assigned-by-dhcp.cox.net>
Hi,
On Tue, 20 Feb 2007, Junio C Hamano wrote:
Show 7 quoted lines
> #!/usr/bin/perl -i.bak -p
> if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
> s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
> }
> if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
> s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
> }Ha, I did it by
$ perl -pi.bup -e \
's/strncmp\( *("[^"]*"), *([^"]*), *[0-9]* *\)/prefixcmp\($2, $1\)/g' \
$(git ls-files)and
$ perl -pi.bup -e \
's/strncmp\( *([^"]*), *("[^"]*"), *[0-9]* *\)/prefixcmp\($1, $2\)/g' \
$(git-ls-files)Of course, I missed the two ,ofs ones, but a git grep -n strncmp brought these up.
Ciao, Dscho