This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Protection against overwriting defsubs.h via a symlink
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 23 Oct 2006 08:28:08 +0000 (08:28 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 23 Oct 2006 08:28:08 +0000 (08:28 +0000)
(by Jim Cromie)

p4raw-id: //depot/perl@29089

ext/B/defsubs_h.PL

index f8c4225..0a1f781 100644 (file)
@@ -4,6 +4,7 @@
 #!perl
 my ($out) = __FILE__ =~ /(^.*)\.PL/i;
 $out =~ s/_h$/.h/;
+unlink $out if -l $out;
 open(OUT,">$out") || die "Cannot open $file:$!";
 print "Extracting $out...\n";
 print OUT <<"END";