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 ca3021a..96a73ae 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";