提交 7dbbd4b3 编写于 作者: D Dr. Stephen Henson

add -stripcr option to copy.pl from 0.9.8

上级 544c84b7
...@@ -8,9 +8,16 @@ use Fcntl; ...@@ -8,9 +8,16 @@ use Fcntl;
# Perl script 'copy' comment. On Windows the built in "copy" command also # Perl script 'copy' comment. On Windows the built in "copy" command also
# copies timestamps: this messes up Makefile dependencies. # copies timestamps: this messes up Makefile dependencies.
my $stripcr = 0;
my $arg; my $arg;
foreach $arg (@ARGV) { foreach $arg (@ARGV) {
if ($arg eq "-stripcr")
{
$stripcr = 1;
next;
}
$arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob... $arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
foreach (glob $arg) foreach (glob $arg)
{ {
...@@ -49,6 +56,10 @@ foreach (@filelist) ...@@ -49,6 +56,10 @@ foreach (@filelist)
|| die "Can't Open $dfile"; || die "Can't Open $dfile";
while (sysread IN, $buf, 10240) while (sysread IN, $buf, 10240)
{ {
if ($stripcr)
{
$buf =~ tr/\015//d;
}
syswrite(OUT, $buf, length($buf)); syswrite(OUT, $buf, length($buf));
} }
close(IN); close(IN);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册