develooper Front page | perl.perl5.porters | Postings from January 2001

[patch: perl@8327] have perlbug's Save to File respect -F flag

From:
Peter Prymmer
Date:
January 5, 2001 13:59
Subject:
[patch: perl@8327] have perlbug's Save to File respect -F flag
Message ID:
Pine.OSF.4.10.10101051357400.28294-100000@aspara.forte.com

The okfile and nokfile targets in the Makefile specify things like:

    -F perl.ok
    -F perl.nok

yet when you run perlbug from make you are prompted like so:

 Action (Send/Display/Edit/Cancel/Save to File): save


 Name of file to save message in [perlbug.rep]:

Which seems to disregard the -F specification.  Here is a patch
that lets the save to file option respect -F if it was given:

--- perl.8327/utils/perlbug.PL.orig	Fri Jan  5 13:33:48 2001
+++ perl.8327/utils/perlbug.PL	Fri Jan  5 13:39:56 2001
@@ -731,10 +731,11 @@
 	    chop $action;
 
 	    if ($action =~ /^(f|sa)/i) { # <F>ile/<Sa>ve
-		print "\n\nName of file to save message in [perlbug.rep]: ";
+		my $file_save = $outfile || "perlbug.rep";
+		print "\n\nName of file to save message in [$file_save]: ";
 		my $file = scalar <>;
 		chop $file;
-		$file = "perlbug.rep" if $file eq "";
+		$file = $file_save if $file eq "";
 
 		unless (open(FILE, ">$file")) {
 		    print "\nError opening $file: $!\n\n";
End of Patch.

Peter Prymmer





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About