On Thu, May 14, 2009 at 9:14 AM, David Mitchell <[email protected]> wrote:
> In perl.git, the branch maint-5.10 has been updated
>
> <http://perl5.git.perl.org/perl.git/commitdiff/2a83af89df68ce54de3e64b6f300ac186c442e8b?hp=45957f2ee9816a6647753f1d918f837b83e9bf04>
>
> - Log -----------------------------------------------------------------
> commit 2a83af89df68ce54de3e64b6f300ac186c442e8b
> Author: Christoph Lamprecht <[email protected]>
> Date: Mon May 11 14:00:11 2009 -0700
>
> do/require don't treat '.\foo' or '..\foo' as "absolute paths" on Windows.
>
> Both 'do' and 'require' treat paths *explicitly* relative to the
> current directory (starting with './' or '../') as a special form of
> absolute path. That means they can be loaded directly and don't need
> to be resolved via @INC, so they don't rely on '.' being in @INC
> (unless running in taint mode). This behavior is "documented" in the P5P
> thread "Coderefs in @INC" from 2002.
>
> The code is missing special treatment of backslashes on Windows
> so that '.\\' and '..\\' are handled in the same manner.
>
> This change fixes
>
> http://rt.perl.org/rt3/Public/Bug/Display.html?id=63492
>
> (Note that the references to taint mode in the bug report are only
> relevant as far as taint mode removes '.' from @INC).
>
> This change also fixes the following Scalar-List-Utils bug report:
>
> http://rt.cpan.org/Public/Bug/Display.html?id=25430
>
> The Scalar::Util test failure in t/p_tainted.t only manifests itself
> under Test::Harness 3, and only outside the Perl core:
>
> * Test::Harness 2 (erroneously) puts '-I.' on the commandline in taint
> mode and runs something like this:
>
> `perl -I. t/p_tainted.t`
>
> so '.\t\tainted.t' can be found via '.' in @INC.
>
> * Core Perl runs something like this from the t/ directory:
>
> `..\perl.exe -I../lib ../ext/List-Util/t/p_tainted.t`
>
> so '.\..\ext\List-Util\t\tained.t' can be found via '../lib' in @INC.
>
> Signed-off-by: Jan Dubois <[email protected]>
>
> (cherry-picked from commit 36f064bc37569629cfa8ffed15497f849ae8ccfa,
> except that I mainly used the pp-ctl.c diff from the original patch rather
> than what went into bleed, due to the MACOS_TRADITIONAL removal
>
> M AUTHORS
> M pp_ctl.c
> M t/run/switcht.t
> diff --git a/pp_ctl.c b/pp_ctl.c
> index c858277..aef521f 100644
> --- a/pp_ctl.c
> +++ b/pp_ctl.c
> @@ -4878,6 +4878,12 @@ S_path_is_absolute(const char *name)
> if (PERL_FILE_IS_ABSOLUTE(name)
> #ifdef MACOS_TRADITIONAL
> || (*name == ':')
> +#ifdef WIN32
> + || (*name == '.' && ((name[1] == '/' ||
> + (name[1] == '.' && name[2] == '/'))
> + || (name[1] == '\\' ||
> + ( name[1] == '.' && name[2] == '\\')))
> + )
> #else
> || (*name == '.' && (name[1] == '/' ||
> (name[1] == '.' && name[2] == '/')))
This change is malformed. The function now looks like:
/* perhaps someone can come up with a better name for
this? it is not really "absolute", per se ... */
static bool
S_path_is_absolute(const char *name)
{
PERL_ARGS_ASSERT_PATH_IS_ABSOLUTE;
if (PERL_FILE_IS_ABSOLUTE(name)
#ifdef MACOS_TRADITIONAL
|| (*name == ':')
#ifdef WIN32
|| (*name == '.' && ((name[1] == '/' ||
(name[1] == '.' && name[2] == '/'))
|| (name[1] == '\\' ||
( name[1] == '.' && name[2] == '\\')))
)
#else
|| (*name == '.' && (name[1] == '/' ||
(name[1] == '.' && name[2] == '/')))
#endif
)
{
return TRUE;
}
else
return FALSE;
}
The first #ifdef is not terminated, and the build fails. (Note: In
blead, the MACOS_TRADITIONAL is removed.)