summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/mklink.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/mklink.pl')
-rw-r--r--src/lib/libcrypto/util/mklink.pl15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/libcrypto/util/mklink.pl b/src/lib/libcrypto/util/mklink.pl
index 9e9c9a5146..9386da7aa4 100644
--- a/src/lib/libcrypto/util/mklink.pl
+++ b/src/lib/libcrypto/util/mklink.pl
@@ -18,10 +18,10 @@
18my $from = shift; 18my $from = shift;
19my @files = @ARGV; 19my @files = @ARGV;
20 20
21my @from_path = split(/\//, $from); 21my @from_path = split(/[\\\/]/, $from);
22my $pwd = `pwd`; 22my $pwd = `pwd`;
23chop($pwd); 23chop($pwd);
24my @pwd_path = split(/\//, $pwd); 24my @pwd_path = split(/[\\\/]/, $pwd);
25 25
26my @to_path = (); 26my @to_path = ();
27 27
@@ -54,7 +54,16 @@ foreach $file (@files) {
54 if ($symlink_exists) { 54 if ($symlink_exists) {
55 symlink("$to/$file", "$from/$file") or $err = " [$!]"; 55 symlink("$to/$file", "$from/$file") or $err = " [$!]";
56 } else { 56 } else {
57 system ("cp", "$file", "$from/$file") and $err = " [$!]"; 57 unlink "$from/$file";
58 open (OLD, "<$file") or die "Can't open $file: $!";
59 open (NEW, ">$from/$file") or die "Can't open $from/$file: $!";
60 binmode(OLD);
61 binmode(NEW);
62 while (<OLD>) {
63 print NEW $_;
64 }
65 close (OLD) or die "Can't close $file: $!";
66 close (NEW) or die "Can't close $from/$file: $!";
58 } 67 }
59 print $file . " => $from/$file$err\n"; 68 print $file . " => $from/$file$err\n";
60} 69}