mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
Fixed MSYS <-> Windows path convertion.
Replaced the Windows real path from mount hack with a more reliable and simpler hack: the MSYS shell has a builtin pwd which understands a -W option which does convertion to Windows paths. Tested and confirmed that this works on all MSYS versions I have back to a 3 year old one.
This commit is contained in:
parent
c27cc4cfe0
commit
e1711b0e9a
@ -2204,44 +2204,10 @@ sub checksystem {
|
|||||||
$libcurl = $2;
|
$libcurl = $2;
|
||||||
if($curl =~ /mingw32/) {
|
if($curl =~ /mingw32/) {
|
||||||
# This is a windows minw32 build, we need to translate the
|
# This is a windows minw32 build, we need to translate the
|
||||||
# given path to the "actual" windows path.
|
# given path to the "actual" windows path. The MSYS shell
|
||||||
|
# has a builtin 'pwd -W' command which converts the path.
|
||||||
my @m = `mount`;
|
$pwd = `sh -c "echo \$(pwd -W)"`;
|
||||||
my $matchlen = 0;
|
chomp($pwd);
|
||||||
my $bestmatch;
|
|
||||||
my $mount;
|
|
||||||
|
|
||||||
# example mount output:
|
|
||||||
# C:\DOCUME~1\Temp on /tmp type user (binmode,noumount)
|
|
||||||
# c:\ActiveState\perl on /perl type user (binmode)
|
|
||||||
# C:\msys\1.0\bin on /usr/bin type user (binmode,cygexec,noumount)
|
|
||||||
# C:\msys\1.0\bin on /bin type user (binmode,cygexec,noumount)
|
|
||||||
|
|
||||||
foreach $mount (@m) {
|
|
||||||
if( $mount =~ /(.*) on ([^ ]*) type /) {
|
|
||||||
my ($mingw, $real)=($2, $1);
|
|
||||||
if($pwd =~ /^$mingw/) {
|
|
||||||
# the path we got from pwd starts with the path
|
|
||||||
# we found on this line in the mount output
|
|
||||||
|
|
||||||
my $len = length($real);
|
|
||||||
if($len > $matchlen) {
|
|
||||||
# we remember the match that is the longest
|
|
||||||
$matchlen = $len;
|
|
||||||
$bestmatch = $real;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!$matchlen) {
|
|
||||||
logmsg "Serious error, can't find our \"real\" path\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
# now prepend the prefix from the mount command to build
|
|
||||||
# our "actual path"
|
|
||||||
$pwd = "$bestmatch$pwd";
|
|
||||||
}
|
|
||||||
$pwd =~ s#\\#/#g;
|
|
||||||
}
|
}
|
||||||
elsif ($curl =~ /win32/) {
|
elsif ($curl =~ /win32/) {
|
||||||
# Native Windows builds don't understand the
|
# Native Windows builds don't understand the
|
||||||
|
Loading…
Reference in New Issue
Block a user