summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2407a17)
This adds a prompt asking for confirmation if the perlbug report would
overwrite an existing file. My guess is that the normal answer will be
yes.
sub save_message_to_disk {
my $file = shift;
sub save_message_to_disk {
my $file = shift;
+ if (-e $file) {
+ my $response = _prompt( '', "Overwrite existing '$file'", 'n' );
+ return undef unless $response =~ / yes | y /xi;
+ }
open OUTFILE, '>:raw', $file or do { warn "Couldn't open '$file': $!\n"; return undef};
binmode(OUTFILE, ':raw :crlf') if $Is_MSWin32;
open OUTFILE, '>:raw', $file or do { warn "Couldn't open '$file': $!\n"; return undef};
binmode(OUTFILE, ':raw :crlf') if $Is_MSWin32;