summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MDK/Common/File.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm
index 87923ee..9b6ee0b 100644
--- a/MDK/Common/File.pm
+++ b/MDK/Common/File.pm
@@ -135,7 +135,11 @@ sub substInFile(&@) {
if (-s $file) {
local @ARGV = $file;
local ($^I, $_) = '';
- while (<>) { &$f($_); print }
+ while (<>) {
+ $_ .= "\n" if eof && !/\n/;
+ &$f($_);
+ print;
+ }
} else {
local *F; my $old = select F; # that way eof return true
local $_ = '';