зеркало из https://github.com/mozilla/pjs.git
Force files to be read as binary to avoid line-ending issues on win32.
Bug #196499
This commit is contained in:
Родитель
53e0e213f5
Коммит
d74da0c02c
|
@ -66,6 +66,7 @@ mozLock($lockfile) unless $nofilelocks;
|
||||||
undef @inbuf;
|
undef @inbuf;
|
||||||
if ( -e "$file" ) {
|
if ( -e "$file" ) {
|
||||||
open(IN, "$file") || die ("$file: $!\n");
|
open(IN, "$file") || die ("$file: $!\n");
|
||||||
|
binmode(IN);
|
||||||
while ($tmp = <IN>) {
|
while ($tmp = <IN>) {
|
||||||
chomp($tmp);
|
chomp($tmp);
|
||||||
push @inbuf, $tmp;
|
push @inbuf, $tmp;
|
||||||
|
@ -84,6 +85,7 @@ $count = $#outbuf + 1;
|
||||||
# Append new entry to file
|
# Append new entry to file
|
||||||
if ($count) {
|
if ($count) {
|
||||||
open(OUT, ">>$file") || die ("$file: $!\n");
|
open(OUT, ">>$file") || die ("$file: $!\n");
|
||||||
|
binmode(OUT);
|
||||||
foreach $entry (@outbuf) {
|
foreach $entry (@outbuf) {
|
||||||
print OUT "$entry\n";
|
print OUT "$entry\n";
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче