Index: tests/runtests.pl
===================================================================
RCS file: /repository/curl/tests/runtests.pl,v
retrieving revision 1.111
diff -u -r1.111 runtests.pl
--- tests/runtests.pl	1 Mar 2004 16:24:54 -0000	1.111
+++ tests/runtests.pl	26 Mar 2004 13:37:42 -0000
@@ -663,21 +663,63 @@
             $curl =~ s/^(.*)(libcurl.*)/$1/g;
             $libcurl = $2;
 
-           if ($curl =~ /win32/)
-           {
-               # Native Windows builds don't understand the
-               # output of cygwin's pwd.  It will be
-               # something like /cygdrive/c/<some path>.
-               #
-               # Use the cygpath utility to convert the
-               # working directory to a Windows friendly
-               # path.  The -m option converts to use drive
-               # letter:, but it uses / instead \.  Forward
-               # slashes (/) are easier for us.  We don't
-               # have to escape them to get them to curl
-               # through a shell.
-               chomp($pwd = `cygpath -m $pwd`);
-           }
+            if($curl =~ /mingw32/) {
+
+                # This is a windows minw32 build, we need to translate the
+                # given path to the "actual" windows path.
+
+                my @m = `mount`;
+                my $matchlen;
+                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($mingw);
+
+                            if($len > $matchlen) {
+                                # we remember the match that is the longest
+                                $matchlen = $len;
+                                $bestmatch = $mingw;
+                            }
+                        }
+                    }
+                }
+                if(!$matchlen) {
+                    print "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";
+                }
+
+            }
+            elsif ($curl =~ /win32/) {
+                # Native Windows builds don't understand the
+                # output of cygwin's pwd.  It will be
+                # something like /cygdrive/c/<some path>.
+                #
+                # Use the cygpath utility to convert the
+                # working directory to a Windows friendly
+                # path.  The -m option converts to use drive
+                # letter:, but it uses / instead \.  Forward
+                # slashes (/) are easier for us.  We don't
+                # have to escape them to get them to curl
+                # through a shell.
+                chomp($pwd = `cygpath -m $pwd`);
+            }
         }
         elsif($_ =~ /^Protocols: (.*)/i) {
             # these are the supported protocols, we don't use this knowledge
