diff options
Diffstat (limited to 'src/lib/libcrypto/util/mklink.pl')
-rw-r--r-- | src/lib/libcrypto/util/mklink.pl | 15 |
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 @@ | |||
18 | my $from = shift; | 18 | my $from = shift; |
19 | my @files = @ARGV; | 19 | my @files = @ARGV; |
20 | 20 | ||
21 | my @from_path = split(/\//, $from); | 21 | my @from_path = split(/[\\\/]/, $from); |
22 | my $pwd = `pwd`; | 22 | my $pwd = `pwd`; |
23 | chop($pwd); | 23 | chop($pwd); |
24 | my @pwd_path = split(/\//, $pwd); | 24 | my @pwd_path = split(/[\\\/]/, $pwd); |
25 | 25 | ||
26 | my @to_path = (); | 26 | my @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 | } |