From: Evan Hunt Date: Wed, 3 Jul 2013 22:57:34 +0000 (-0700) Subject: [master] fix todos bug X-Git-Tag: v9.10.0a1~241 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13897b1d33fe65f669d68e96ee227437b016d702;p=thirdparty%2Fbind9.git [master] fix todos bug --- diff --git a/win32utils/todos.pl b/win32utils/todos.pl index a149465ca59..2baf66342ae 100644 --- a/win32utils/todos.pl +++ b/win32utils/todos.pl @@ -24,16 +24,27 @@ use strict; use File::Find; sub todos { - local ($^I, @ARGV) = (defined, @_); - while (<>) { - s/[\r\n]+$/\r\n/; - print; - } + local @ARGV = @_; + unshift (@ARGV, '-') unless @ARGV; + while ($ARGV = shift) { + open(FH, $ARGV); + binmode(FH); + my @lines = ; + close(FH); + + open(FH, ">$ARGV"); + binmode(FH); + for my $line (@lines) { + $line =~ s/[\r\n]+$/\r\n/; + print FH $line; + } + close(FH); + } } sub wanted { - return unless -f && $_ =~ qr/\.(mak|dsp|dsw|txt|bat)$/; - todos $File::Find::dir . "/" . $_; + return unless -f && $_ =~ qr/\.(mak|dsp|dsw|txt|bat)$/; + todos $_; } finddepth(\&wanted, "..");