Protection against overwriting defsubs.h via a symlink
Rafael Garcia-Suarez [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";