]> git.donarmstrong.com Git - debbugs.git/commitdiff
use slurp and io file to read the original report
authorDon Armstrong <don@donarmstrong.com>
Thu, 12 Jul 2012 23:57:11 +0000 (16:57 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 12 Jul 2012 23:57:11 +0000 (16:57 -0700)
scripts/process

index 05ade0aa01c464c08675ed03adbeb0bf69a6689f..40bc1fccc2edb0597672c09c9366be9a27872369 100755 (executable)
@@ -440,8 +440,12 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
        writebug($ref, $data);
 
        my $hash = get_hashname($ref);
-        open(O,"db-h/$hash/$ref.report") || die "read original report: $!";
-        my $orig_report= join('',<O>); close(O);
+       my $orig_report_fh = IO::File->new("db-h/$hash/$ref.report") or
+           die "Unable to read original report: $!";
+       my $orig_report;
+       { local $/; $orig_report = <$orig_report_fh>;}
+       close($orig_report_fh) or
+           die "Unable to close original report filehandle: $!";
         if ($codeletter eq 'F') {
            &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
             &sendmessage(create_mime_message(