Bug 336320: Doctor incorrectly uses CRLF (\r\n) instead of LF (\n) line terminator - Patch by Frédéric Buclin <LpSolit@gmail.com> r=myk

git-svn-id: svn://10.0.0.236/trunk@195986 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com 2006-05-04 19:16:41 +00:00
parent 2ea54fcb0a
commit b273f03fbe

View File

@ -214,7 +214,10 @@ sub relative_spec {
sub add {
my $self = shift;
my $content = shift;
# Convert line breaks to UNIX EOL for new files, by default.
$content =~ s/\r\n|\r/\n/g;
my $olddir = getcwd();
chdir $self->tempdir;
@ -251,6 +254,10 @@ sub patch {
my $self = shift;
my $newcontent = shift;
# Convert line breaks to whatever the file in CVS uses.
my $linebreak = $self->linebreak;
$newcontent =~ s/\r\n|\r|\n/$linebreak/g;
my $olddir = getcwd();
chdir $self->tempdir;
-e $self->spec or $self->checkout();