Minor portability update to c_rehash.
authorAndy Polyakov <appro@openssl.org>
Thu, 26 Oct 2006 10:52:12 +0000 (10:52 +0000)
committerAndy Polyakov <appro@openssl.org>
Thu, 26 Oct 2006 10:52:12 +0000 (10:52 +0000)
tools/c_rehash.in

index ca3021ae8a4ff2ccf1a2f121a60f8ba6e20c9aef..96a73aeedd835c220d41053322770e8ec2b05b3f 100644 (file)
@@ -15,7 +15,13 @@ if(defined $ENV{OPENSSL}) {
        $ENV{OPENSSL} = $openssl;
 }
 
-my $pwd = `pwd`; chomp $pwd;
+my $pwd;
+eval "require Cwd";
+if (defined(&Cwd::getcwd)) {
+       $pwd=Cwd::getcwd();
+} else {
+       $pwd=`pwd`; chomp($pwd);
+}
 my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; # DOS/Win32 or Unix delimiter?
 
 $ENV{PATH} .= "$path_delim$dir/bin";