delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/12/12:41:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4B4CB44F.2030609@x-ray.at>
Date: Tue, 12 Jan 2010 18:41:35 +0100
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.6) Gecko/20091206 SeaMonkey/2.0.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Perl, abs_path from Version 5.10.1-1 to 5.10.1-2 changed behaviour (no longer uses fast_path?)
References: <6fa8f66b58b73548b9a6d0e0f8a84018 AT localhost>
In-Reply-To: <6fa8f66b58b73548b9a6d0e0f8a84018@localhost>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Thorsten Gunkel schrieb:
> Hi *,
> I have a perl script, which stopped working, when I recently updated cygwin
> to 1.7.
>
> Here is a small demo script which shows the problem. It just calls abs_path()
> with different values and prints the output. It would be great if anyone
> could confirm that they also see this behaviour.
>
>
> #!/bin/env perl
>
> use strict;
> use Cwd 'abs_path';
>
> abs_path_WITHDEBUG(".");
> abs_path_WITHDEBUG("C:\\");
> abs_path_WITHDEBUG("C:\\Program Files\\");
> abs_path_WITHDEBUG("C:\\Does Not Exist\\");
> exit;
>
> sub abs_path_WITHDEBUG
> {
>    my $pPath = shift;
>    my $result_path=abs_path($pPath);
>    print "Test: \n PrePath={".$pPath."}\nPostPath={".$result_path."}\n\n";
>    return $result_path;
> }
>
>
>
> When called with current Perl Version 5.10.1-2 it shows this output:
> Test:
>   PrePath={.}
> PostPath={/tmp}
>
> Test:
>   PrePath={C:\}
> PostPath={/tmp/C:\}<--- broken
>
> Test:
>   PrePath={C:\Program Files\}
> PostPath={/tmp/C:\Program Files\}<--- broken
>
> Test:
>   PrePath={C:\Does Not Exist\}
> PostPath={/tmp/C:\Does Not Exist\}<--- broken
>
> Please notice, that the Windows path is justed added to the current
> Unix path (which results in a broken path)
>
>
> When I manually downgrade Perl to Version 5.10.1-1 it shows this output:
> Test:
>   PrePath={.}
> PostPath={/tmp}
>
> Test:
>   PrePath={C:\}
> PostPath={/cygdrive/c}
>
> Test:
>   PrePath={C:\Program Files\}
> PostPath={/cygdrive/c/Program Files}
>
> C:\Does Not Exist\: No such file or directory at ./demo.pl line 20
>
> Here I get the correct Unix path in all cases.
>
> The difference seems to be in Cwd.pm:
>
> diff -u -U5 Cwd.pm*
> --- Cwd.pm_old  2010-01-12 15:37:19.718007800 +0100
> +++ Cwd.pm_new  2010-01-12 15:46:32.159043400 +0100
> @@ -303,11 +303,11 @@
>      cygwin =>
>      {
>       getcwd             =>  'cwd',
>       fastgetcwd         =>  'cwd',
>       fastcwd            =>  'cwd',
> -    abs_path           =>  'fast_abs_path',
> +#   abs_path           =>  'fast_abs_path',
>       realpath           =>  'fast_abs_path',
>      },
>
>      epoc =>
>      {
> @@ -817,8 +817,8 @@
>   *abs_path = \&_perl_abs_path unless defined&abs_path;
>   *getcwd = \&_perl_getcwd unless defined&getcwd;
>
>   # added function alias for those of us more
>   # used to the libc function.  --tchrist 27-Jan-00
> -*realpath = \&abs_path;
> +*realpath = \&abs_path unless defined&realpath;
>
>   1;
>
> So abs_path used to point to fast_abs_path, but does not longer for Cygwin?
> When I use fast_abs_path instead of abs_path in my test script it works for
> both perl versions 5.10.1-1 and 5.10.1-2. What was wrong with fast_abs_path?
> Should I just replace abs_path to fast_abs_path?

Yes please, until we come up with a satisfactory solution for all problems.

It was caused by a patch request from Eliott Moss
http://sourceware.org/ml/cygwin/2009-12/msg00506.html for svk,
which caused no regressions in the tests.

I'll talk to Stefan Müller to add such tests to the PathTools package.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019