---- Changes since 1.370 ----
Hid the Jabber and Security Sentries modules by default, as the underlying software is no longer supported.
On Linux systems, sped up the function for finding processes so that it no longer has to launch 'ps' - instead, it reads /proc directly.
+When read_file_lines is used to read a file, the Unix or Windows newlines will be preserved when it is written out.
}
local $realfile = &translate_filename($_[0]);
if (!$main::file_cache{$realfile}) {
- local(@lines, $_);
+ local(@lines, $_, $eol);
open(READFILE, $realfile);
while(<READFILE>) {
+ if (!$eol) {
+ $eol = /\r\n$/ ? "\r\n" : "\n";
+ }
tr/\r\n//d;
push(@lines, $_);
}
close(READFILE);
$main::file_cache{$realfile} = \@lines;
$main::file_cache_noflush{$realfile} = $_[1];
+ $main::file_cache_eol{$realfile} = $eol || "\n";
}
else {
# Make read-write if currently readonly
else {
@files = ( keys %main::file_cache );
}
-local $eol = $_[1] || "\n";
foreach $f (@files) {
+ local $eol = $_[1] || $main::file_cache_eol{$f} || "\n";
if (!$main::file_cache_noflush{$f}) {
&open_tempfile(FLUSHFILE, ">$f");
local $line;