The cbc functions shouldn't be inside #ifdef OPENSSL_NO_TLSEXT
[openssl.git] / util / mklink.pl
index 9386da7aa4c3a3f0f02e3d32583c06b0684f6e8b..eacc32788264f5c3fcbfe7cfa9935ba6df363c02 100755 (executable)
 # Apart from this, this script should be able to handle even the most
 # pathological cases.
 
+my $pwd;
+eval 'use Cwd;';
+if ($@)
+       {
+       $pwd = `pwd`;
+       }
+else
+       {
+       $pwd = getcwd();
+       }
+
 my $from = shift;
 my @files = @ARGV;
 
 my @from_path = split(/[\\\/]/, $from);
-my $pwd = `pwd`;
-chop($pwd);
+chomp($pwd);
 my @pwd_path = split(/[\\\/]/, $pwd);
 
 my @to_path = ();
@@ -52,6 +62,7 @@ $symlink_exists=eval {symlink("",""); 1};
 foreach $file (@files) {
     my $err = "";
     if ($symlink_exists) {
+       unlink "$from/$file";
        symlink("$to/$file", "$from/$file") or $err = " [$!]";
     } else {
        unlink "$from/$file";