platform/upstream/perl.git
12 years agoFill out sv_upgrade docs
Father Chrysostomos [Fri, 4 Nov 2011 15:35:40 +0000 (08:35 -0700)]
Fill out sv_upgrade docs

See commit 5a0c33f0f.

12 years agoRestore VMS glob skip removed in 1bb8785a.
Craig A. Berry [Fri, 4 Nov 2011 16:10:02 +0000 (11:10 -0500)]
Restore VMS glob skip removed in 1bb8785a.

The test appears to be checking the handling of double quotes in
File::Glob::csh_glob(), but on VMS, we're not using that, we're
using Perl_vms_start_glob().  Perhaps the latter should do some
quote removal as well.

12 years agoFix hang in ext/POSIX/t/sysconf.t on GNU/Hurd
Pino Toscano [Mon, 31 Oct 2011 21:37:04 +0000 (21:37 +0000)]
Fix hang in ext/POSIX/t/sysconf.t on GNU/Hurd

while compiling perl 5.14.2 on GNU/Hurd, I ran into what it seems a
undefined POSIX behaviour in ext/POSIX/t/sysconf.t.

      my $fd = POSIX::open($fifo, O_RDWR)
      or skip("could not open $fifo ($!)", 3 * @path_consts_fifo);

according to the POSIX open()[1] about O_RDWR,
  The result is undefined if this flag is applied to a FIFO.
.... which is actually our case.
Apparently Linux and *FreeBSD (and maybe also OSes) accept this
behaviour, but on GNU/Hurd this causes the open() call to block
undefinitely. Given there's nothing done with the FIFO if not querying
{,f}pathconf() values, the proposed solution I attached is to change
the opening mode to "O_RDONLY | O_NONBLOCK".

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

12 years agoUse SvUPGRADE, not sv_upgrade, in sv_sethek
Father Chrysostomos [Fri, 4 Nov 2011 07:17:52 +0000 (00:17 -0700)]
Use SvUPGRADE, not sv_upgrade, in sv_sethek

This was causing some interesting HTML::Element failures, which were
only triggered by HTML::DOM’s test suite.

ref’s TARG can become tainted if another op in the same statement
turns on tainting for the rest of the statement, so it becomes a PVMG.
The next call to the same ref will try to sv_upgrade it to a PV (which
is lower).  Only the macro version, SvUPGRADE, checks whether the
upgrade is needed.

ref only calls sv_sethek when it has a blessed object for its argu-
ment, hence the strange-looking test.

12 years agoDeparse ()[()]
Father Chrysostomos [Fri, 4 Nov 2011 05:36:23 +0000 (22:36 -0700)]
Deparse ()[()]

A pushmark doesn’t have to have a sibling:

$ ./perl -Ilib -MO=Concise -e '()[()]'
6  <@> leave[1 ref] vKP/REFC ->(end)
1     <0> enter ->2
2     <;> nextstate(main 1 -e:1) v:{ ->3
5     <2> lslice vK/2 ->6
-        <1> ex-list lK ->4
3           <0> pushmark s ->4
-           <0> stub lP ->-
-        <1> ex-list lK ->5
4           <0> pushmark s ->5            <-- look here!
-e syntax OK

12 years agoStop @{""} = reverse @_ from crashing
Father Chrysostomos [Thu, 3 Nov 2011 21:47:06 +0000 (14:47 -0700)]
Stop @{""} = reverse @_ from crashing

Class::ClassDecorator was crashing during compilation on this line:

        @{"$name\::ISA"} = ( reverse @_ );

I presume this was due to commit 540dd770, which changed the way the
inplace-reverse optimisation is activated, because the crash happens
in S_inplace_aassign.  But deleting even one line of code here or
there makes the crash go away (hence the lack of tests).

This is my reasoning for how this commit eliminates the crash:

    @{""} = reverse @_

compiles down to

b     <2> aassign[t5] vKS/COMMON ->c
-        <1> ex-list lK ->8
3           <0> pushmark s ->4
7           <@> reverse[t4] lK/1 ->8
4              <0> pushmark s ->5
6              <1> rv2av[t3] lK/1 ->7
5                 <#> gv[*_] s ->6
-        <1> ex-list lK ->b
8           <0> pushmark s ->9
a           <1> rv2av[t1] lKRM*/1 ->b
-              <@> scope sK ->a
-                 <0> ex-nextstate v ->9
9                 <$> const[PV ""] s ->a

Notice that the second rv2av does not have an a gv op as its child,
but a scope instead.

In S_inplace_aassign, which checks to see whether the optimisation is
even possible, oleft refers to the second rv2av above (with scope as
its child; i.e., @{""}) while oright refers to the first rv2av (with
gv as its child; @_).

This check to make sure the left side is an array

    /* Check the lhs is an array */
    if (!oleft ||
(oleft->op_type != OP_RV2AV && oleft->op_type != OP_PADAV)
|| oleft->op_sibling
|| (oleft->op_private & OPpLVAL_INTRO)
    )
return;

does not check the op type of the rv2av’s child.

So this check, a little further on, to see whether the arrays are the
same on both sides (which applies only to rv2av; padav is handled
further on):

    /* check the array is the same on both sides */
    if (oleft->op_type == OP_RV2AV) {
if (oright->op_type != OP_RV2AV
    || !cUNOPx(oright)->op_first
    || cUNOPx(oright)->op_first->op_type != OP_GV
    || cGVOPx_gv(cUNOPx(oleft)->op_first) !=
       cGVOPx_gv(cUNOPx(oright)->op_first)
)
    return;

assumes that cUNOPx(oleft)->op_first is a gv op.

That is not the case when the lhs is @{""}, so
cGVOPx_gv(some_scope_op) ends up trying to read
((PADOP*)some_scope_op)->op_padix under threaded perls, passing
that ‘index’ (which is actually the scope op’s op_first field) to
PAD_SV[...], consequently reading past the end of the pad and possibly
into unallocated territory; hence the crash.

12 years agoMake Storable load even with %INC modified
Father Chrysostomos [Thu, 3 Nov 2011 00:04:33 +0000 (17:04 -0700)]
Make Storable load even with %INC modified

Modified to stop Log::Agent from loading, that is.

There’s at least one CPAN module that does it.  While that module
could be blamed, Storable used to be more robust in this area
before the AutoLoader extirpation, and there is nothing wrong with
robustness.

12 years agoErrno does not escape archname
Reini Urban [Wed, 2 Nov 2011 18:17:15 +0000 (13:17 -0500)]
Errno does not escape archname

With a @ or $ or % character in the user-choosen archname, Errno fails.
I usually use @ to denote git tags in the archlib.

E.g. Possible unintended interpolation of @khwtk in string at ../lib/Errno.pm line 12

12 years agoUpdate ExtUtils-MakeMaker to CPAN version 6.63_02
Steve Hay [Wed, 2 Nov 2011 09:30:05 +0000 (09:30 +0000)]
Update ExtUtils-MakeMaker to CPAN version 6.63_02

12 years agoMake diag.t runnable outside t/
Father Chrysostomos [Wed, 2 Nov 2011 01:49:16 +0000 (18:49 -0700)]
Make diag.t runnable outside t/

12 years agoWarn for $[ ‘version’ checks
Father Chrysostomos [Wed, 2 Nov 2011 01:25:59 +0000 (18:25 -0700)]
Warn for $[ ‘version’ checks

Following Michael Schwern’s suggestion, here is a warning for those
hapless folks who use $[ for version checks.

It applies whenever $[ is used in one of: < > <= >=

12 years agoPATCH: [perl #101710] Regression with /i, latin1 chars.
Karl Williamson [Tue, 1 Nov 2011 23:57:15 +0000 (17:57 -0600)]
PATCH: [perl #101710] Regression with /i, latin1 chars.

The root cause of this bug is that it was assuming that a string was in
utf8 when it wasn't, and so was thinking that a byte was a starter byte
that wasn't, so was skipping ahead based on that starter byte.

12 years agoIn bisect.pl, provide a default test for --validate, and summary output.
Nicholas Clark [Tue, 1 Nov 2011 21:48:41 +0000 (22:48 +0100)]
In bisect.pl, provide a default test for --validate, and summary output.

If no test case is specified for --validate, use TEST to run t/base/*.t
We can't run minitest because some tests fail on earlier versions, and
bisect-runner.pl intentionally doesn't patch any regression tests.

12 years agoAdd -l and -w options to bisect-runner.pl, for use with -e
Nicholas Clark [Tue, 1 Nov 2011 21:04:08 +0000 (22:04 +0100)]
Add -l and -w options to bisect-runner.pl, for use with -e

This allows simpler one-liners with -e and print, as one no longer needs to
add "\n" to all output. Reformat the example for --validate to use -l instead
of "\n".

12 years agoIn bisect.pl, use --start and --end to give ranges to --validate
Nicholas Clark [Tue, 1 Nov 2011 19:48:30 +0000 (20:48 +0100)]
In bisect.pl, use --start and --end to give ranges to --validate

This allows the user to specify a subset of revisions to test build.

12 years agoAdd --force-regen to bisect-runner.pl to regen_headers before building.
Nicholas Clark [Tue, 1 Nov 2011 19:31:43 +0000 (20:31 +0100)]
Add --force-regen to bisect-runner.pl to regen_headers before building.

--force-regen runs C<make regen_headers> before building F<miniperl>. This
may fix a build that otherwise would skip because the generated headers at
that revision are stale. It's not the default because it conceals this error
in the true state of such revisions.

12 years agoIn bisect-runner.pl, remove "faking it" code from the main flow.
Nicholas Clark [Tue, 1 Nov 2011 16:51:50 +0000 (17:51 +0100)]
In bisect-runner.pl, remove "faking it" code from the main flow.

Refactor the code to fake a correct MANIFEST into force_manifest() and
force_manifest_cleanup(). Refactor the code that emulates -Dnoextensions
into fake_noextensions().

This should make it easier to see the main flow of the program.

12 years agoIn bisect-runner.pl, consolidate the code that patches extensions.
Nicholas Clark [Tue, 1 Nov 2011 16:04:01 +0000 (17:04 +0100)]
In bisect-runner.pl, consolidate the code that patches extensions.

All the code that patches extensions extensions is now moved to patch_ext().

12 years agoIn bisect-runner.pl, consolidate the code that patches .SH and C files.
Nicholas Clark [Tue, 1 Nov 2011 14:57:07 +0000 (15:57 +0100)]
In bisect-runner.pl, consolidate the code that patches .SH and C files.

All the code that patches .SH files is now moved to patch_SH().
All the code that patches C files is now moved to patch_C().

12 years agoIn bisect-runner.pl, consolidate the code that patches Configure and hints.
Nicholas Clark [Tue, 1 Nov 2011 13:00:21 +0000 (14:00 +0100)]
In bisect-runner.pl, consolidate the code that patches Configure and hints.

All the code that patches Configure is now moved to patch_Configure().
All the code that patches hints files is now moved to patch_hints().

This should start to make it easier to see the main flow of the program.

12 years agoAdd a --validate option to bisect.pl to verify that stable releases build.
Nicholas Clark [Tue, 1 Nov 2011 11:44:57 +0000 (12:44 +0100)]
Add a --validate option to bisect.pl to verify that stable releases build.

This is useful for validating a new OS/CPU/compiler combination, and for
checking that refactoring bisect-runner.pl hasn't broken any that previously
worked.

12 years agoFix third argument to setresgid call while setting $(.
Leon Timmermans [Tue, 13 Sep 2011 20:04:23 +0000 (22:04 +0200)]
Fix third argument to setresgid call while setting $(.

[Committer's note: discussion on perl5-security-report concluded that
exploitability was low to nonexistent because any system that has setresgid
but not setregid will pretend to have the latter and define it in terms
of the former (see "#ifndef HAS_SETREGID" in perl.h).  But the bug should
be fixed in case that code gets exposed in the future.  The approach
taken in perl.h was also called into question and may elicit further
discussion and patching.]

Note: bug this only affects systems that have setresgid but not setregid
(since that codepath prefers the latter over the former). To the best of
my knowledge, no such systems exists (nor would it make much sense) so
this bug is probably not exploitable, but I can't guarantee that.

When the effective group is set using setresgid, it does this:
  setresgid((Gid_t)PL_gid, (Gid_t)-1, (Gid_t) 1);
That last 1 should have been a -1. Instead of leaving the saved GID
unchanged it sets it to to 1. This means privileges are not permanently
dropped, but instead the GID is set to 1 (if possible). The program can
thereafter change it's effective and real GIDs to 1.

12 years agoperlfunc/glob: Explain use of quotes
Tom Christiansen [Mon, 31 Oct 2011 16:59:11 +0000 (09:59 -0700)]
perlfunc/glob: Explain use of quotes

12 years agoperldelta update
Father Chrysostomos [Mon, 31 Oct 2011 15:53:10 +0000 (08:53 -0700)]
perldelta update

12 years agot/porting/authors.t can send just the git log info needed by checkAUTHORS.pl
Nicholas Clark [Thu, 27 Oct 2011 11:38:46 +0000 (13:38 +0200)]
t/porting/authors.t can send just the git log info needed by checkAUTHORS.pl

Using a custom pretty format to reduce the data passed drops the runtime by
about 25%. Admittedly small in absolute terms, but an easy change whose
gains will slowly accumulate.

12 years agoRemove $date from Porting/checkAUTHORS.pl, which was never used.
Nicholas Clark [Thu, 27 Oct 2011 11:17:08 +0000 (13:17 +0200)]
Remove $date from Porting/checkAUTHORS.pl, which was never used.

It was added in commit 00229b9760c33911, along with the pattern which
captured the value of 'AuthorDate:', when checkAUTHORS.pl was converted to
parsing the output of git log instead of p4 log. Neither the old nor the new
code made any use of dates, hence the variable (and the capture) were never
needed.

12 years agoImprove general GNU hints, needed for GNU/Hurd.
Pino Toscano [Wed, 10 Aug 2011 05:11:33 +0000 (08:11 +0300)]
Improve general GNU hints, needed for GNU/Hurd.

Bug-Debian: http://bugs.debian.org/636609

Patch-Name: fixes/hurd-hints.diff

With minor modifications to add Pino to AUTHORS.

12 years agoCorrect FreeBSD hints file for FreeBSD 10.0
Jilles Tjoelker [Sun, 30 Oct 2011 09:53:43 +0000 (10:53 +0100)]
Correct FreeBSD hints file for FreeBSD 10.0

Perl does not build on FreeBSD 10.0 because some checks in
hints/freebsd.sh think FreeBSD 10 is FreeBSD 1 and therefore enable
behaviour only appropriate for a.out systems.

The below patch was included in the lang/perl5.12 port and fixes its
build. The resulting binaries are also suitable to compile other ports.
I have also verified that this patch applies to lang/perl5.10 and
lang/perl5.14, making them build.

12 years agoAdd Jilles Tjoelker to AUTHORS.
Nicholas Clark [Sun, 30 Oct 2011 09:35:55 +0000 (10:35 +0100)]
Add Jilles Tjoelker to AUTHORS.

12 years agoRemove some repeated code in pp_regcomp
Father Chrysostomos [Sat, 29 Oct 2011 20:41:13 +0000 (13:41 -0700)]
Remove some repeated code in pp_regcomp

12 years agoFix =~ $str_overloaded (5.10 regression)
Father Chrysostomos [Sat, 29 Oct 2011 20:40:06 +0000 (13:40 -0700)]
Fix =~ $str_overloaded (5.10 regression)

In 5.8.x, this code:

  use overload '""'=>sub { warn "stringify"; --$| ? "gonzo" : chr 256 };
  my $obj = bless\do{my $x};
  warn "$obj";
  print "match\n" if chr(256) =~ $obj;

prints

  stringify at - line 1.
  gonzo at - line 3.
  stringify at - line 1.
  match

which is to be expected.

In 5.10+, the stringification happens one extra time, causing a failed match:

  stringify at - line 1.
  gonzo at - line 3.
  stringify at - line 1.
  stringify at - line 1.

This logic in pp_regcomp is faulty:

    if (DO_UTF8(tmpstr)) {
assert (SvUTF8(tmpstr));
    } else if (SvUTF8(tmpstr)) {
... copy under ‘use bytes’...
    }
    else if (SvAMAGIC(tmpstr)) {
/* make a copy to avoid extra stringifies */
tmpstr = newSVpvn_flags(t, len, SVs_TEMP | SvUTF8(tmpstr));
    }

The SvAMAGIC check never happens when the UTF8 flag is on.

12 years agoIncrease $strict::VERSION to 1.05
Father Chrysostomos [Sat, 29 Oct 2011 18:55:09 +0000 (11:55 -0700)]
Increase $strict::VERSION to 1.05

12 years agounconfuse strict.pm documentation
Moritz Lenz [Sat, 29 Oct 2011 18:21:40 +0000 (20:21 +0200)]
unconfuse strict.pm documentation

my() does not localize variables, and reusing variable names is
confusing too

12 years agoDosGlob: Comment typo
Father Chrysostomos [Sat, 29 Oct 2011 18:48:41 +0000 (11:48 -0700)]
DosGlob: Comment typo

12 years agoDosGlob: Don’t parse an pattern that will not be used
Father Chrysostomos [Sat, 29 Oct 2011 18:47:25 +0000 (11:47 -0700)]
DosGlob: Don’t parse an pattern that will not be used

This is the same change for efficiency’s sake that was applied to
File::Glob in commit edfed4c3099a.

12 years agoFile::Glob: Consistent use of spaces after dots
Father Chrysostomos [Sat, 29 Oct 2011 16:56:23 +0000 (09:56 -0700)]
File::Glob: Consistent use of spaces after dots

(except after e.g.)

12 years agoFile::Glob: Remove docs specific to Mac Classic
Father Chrysostomos [Sat, 29 Oct 2011 16:54:59 +0000 (09:54 -0700)]
File::Glob: Remove docs specific to Mac Classic

These have been obsolete since commit e37778c28b in 2009.

12 years agoDocument File::Glob::csh_glob
Father Chrysostomos [Sat, 29 Oct 2011 16:52:45 +0000 (09:52 -0700)]
Document File::Glob::csh_glob

In <https://rt.cpan.org/Ticket/Display.html?id=72021>, Damian Con-
way writes:

> PS: List::Maker previously followed the documented behaviour of
>     File::Glob, rather than the actual behaviour. So there's arguably a
>     bug in File::Glob as well. ;-)

List::Maker was forwarding calls to File::Glob::bsd_glob from its
global override in scopes where its override did not apply.  The
File::Glob documentation was misleading and implied that that was the
correct thing to do.

12 years agoPATCH: [perl #101940]: BBC Tk
Karl Williamson [Sat, 29 Oct 2011 17:20:40 +0000 (11:20 -0600)]
PATCH: [perl #101940]: BBC Tk

This commit that turned up this bug turns out merely exposes an
underlying problem that could be generated via other means.

regcomp.c was looking at the SvUTF8 flag on the input pattern before
doing an SvPV on it.  Generally the flag is considered not reliable
unless checked immediately after a SvPV.

I haven't been able to come up with a simple test case that reproduces
the bug.  I suspect that XS code is required to trigger it.

12 years agoregcomp.c: Use no_mg for 2nd fetch of pattern
Karl Williamson [Sat, 29 Oct 2011 15:48:43 +0000 (09:48 -0600)]
regcomp.c: Use no_mg for 2nd fetch of pattern

The pattern could be tied, for example, and so only want to access it
once.  I couldn't come up with a test case that actually exercised this,
but I can think of future changes to regcomp that would.

12 years agoFix spelling in comment
Karl Williamson [Sat, 29 Oct 2011 14:52:07 +0000 (08:52 -0600)]
Fix spelling in comment

12 years agoGlob.xs: Remove dMY_CXT from bsd_glob
Father Chrysostomos [Sat, 29 Oct 2011 08:20:28 +0000 (01:20 -0700)]
Glob.xs: Remove dMY_CXT from bsd_glob

It has been redundant since 1bb8785a (when bsd_glob was still
called doglob).

12 years agoDosGlob: eliminate %iter
Father Chrysostomos [Sat, 29 Oct 2011 07:56:20 +0000 (00:56 -0700)]
DosGlob: eliminate %iter

This hash is redundant, as the presence of an entry in %entries is
sufficient.

12 years agoIncrease $File::DosGlob::VERSION to 1.07
Father Chrysostomos [Sat, 29 Oct 2011 07:53:59 +0000 (00:53 -0700)]
Increase $File::DosGlob::VERSION to 1.07

12 years agoGlob.xs: Clarify comment
Father Chrysostomos [Sat, 29 Oct 2011 07:52:46 +0000 (00:52 -0700)]
Glob.xs: Clarify comment

12 years agoGlob.xs: Remove comment
Father Chrysostomos [Sat, 29 Oct 2011 07:51:42 +0000 (00:51 -0700)]
Glob.xs: Remove comment

This was obsoleted by commit f4cbf9907d.

12 years agoGlob.xs: consting
Father Chrysostomos [Sat, 29 Oct 2011 07:50:44 +0000 (00:50 -0700)]
Glob.xs: consting

12 years agoGlob.xs: Be more parsimonious with SVs
Father Chrysostomos [Sat, 29 Oct 2011 07:49:37 +0000 (00:49 -0700)]
Glob.xs: Be more parsimonious with SVs

Since this is XS code, we don’t have to store array references in
a hash.  We can just store the arrays themselves.

12 years agoGlob.xs: Remove comment
Father Chrysostomos [Sat, 29 Oct 2011 07:36:12 +0000 (00:36 -0700)]
Glob.xs: Remove comment

This not longer applies really, as I’ve significantly modified it.

12 years agoOops: Fix Glob.xs assertion failure
Father Chrysostomos [Sat, 29 Oct 2011 07:34:17 +0000 (00:34 -0700)]
Oops: Fix Glob.xs assertion failure

This happens under :bsd_glob when <>/glob is called in list context.

12 years agoGlob.xs: Eliminate x_GLOB_ITER
Father Chrysostomos [Sat, 29 Oct 2011 07:29:21 +0000 (00:29 -0700)]
Glob.xs: Eliminate x_GLOB_ITER

There is no need to keep a separate scalar to remember the number of
items in an array.  We can just use the array.

12 years agoDocument File::Glob’s :bsd_glob tag
Father Chrysostomos [Sat, 29 Oct 2011 07:19:25 +0000 (00:19 -0700)]
Document File::Glob’s :bsd_glob tag

12 years agoAdd :bsd_glob export tag to File::Glob [perl #96116]
Father Chrysostomos [Sat, 29 Oct 2011 07:02:01 +0000 (00:02 -0700)]
Add :bsd_glob export tag to File::Glob [perl #96116]

This is intended to replace the :glob export tag.  The problem with
:glob is that the glob export (File::Glob::glob) does not support ite-
ration, but tries to return a whole list each time; hence it causes
while(<*>) to loop endlessly, as it is repeatedly returning the last
file (scalar context).

Since there may be code relying on that, we cannot easily change it,
but we can supplant it.

Since bsd_glob is already documented as supporting spaces in patterns
(that match spaces in file names; i.e., that are not separators), this
commit adds a :bsd_glob export tag that only differs from :glob in
that the exported glob() function iterates in scalar context.

An imminent commit will add documentation.

12 years agoGlob.xs: Refactor iteration into separate function
Father Chrysostomos [Sat, 29 Oct 2011 05:47:20 +0000 (22:47 -0700)]
Glob.xs: Refactor iteration into separate function

Parsing of a glob pattern and iteration logic are now in separate
functions, so that another function (soon to be added) can share
the same iteration code.

12 years agoMove the do() test in Deparse’s core.t
Father Chrysostomos [Sat, 29 Oct 2011 05:10:58 +0000 (22:10 -0700)]
Move the do() test in Deparse’s core.t

It should be in the list of unary, not nullary, functions.

I’m surprised the tests passed on non-mad builds.

12 years agoRemove unnecessary cruft from the module example.
Michael G. Schwern [Sun, 23 Oct 2011 02:32:04 +0000 (19:32 -0700)]
Remove unnecessary cruft from the module example.

This makes it more like a real module would be written while retaining it's utility as a teaching boilerplate.

* require Exporter instead of use with no import
* Declare and initialize variables together.
* Eliminate archaic RCS/CVS versioning clutter.
* Explain what @ISA does.
* Remove archaic (and slower) &func syntax from exporting
* Remove %EXPORT_TAGS.  It's not explained and rarely used.
* Remove redundant @EXPORT_OK
* Use cleaner $priv_func->() syntax rather than &$priv_func.
* Eliminate prototypes, they're clutter, rarely used and dangerous.

TonyC: update known_pod_issues.dat

12 years agoproduce a properly sorted known_pod_issues.dat
Tony Cook [Sat, 29 Oct 2011 03:11:58 +0000 (14:11 +1100)]
produce a properly sorted known_pod_issues.dat

e08998bf6 changed the generated sort order but didn't regen the file.

12 years agoFixed dative inaccuracy in perlmod.pod.
chromatic [Sun, 23 Oct 2011 01:18:22 +0000 (18:18 -0700)]
Fixed dative inaccuracy in perlmod.pod.

12 years agoRemove unnecessary makefile fix-up code from bisect-runner.pl
Nicholas Clark [Fri, 28 Oct 2011 14:13:18 +0000 (16:13 +0200)]
Remove unnecessary makefile fix-up code from bisect-runner.pl

As it always uses blead's version of makedepend, there's no need to correct
makefile and x2p/makefile for mistakes left by earlier versions of makedepend.

12 years agoIn bisect-runner.pl, patch older Configure to add -A
Nicholas Clark [Fri, 28 Oct 2011 13:56:00 +0000 (15:56 +0200)]
In bisect-runner.pl, patch older Configure to add -A

Having -A to append to options is incredibly useful in some situations, and
working round it can be hard, or have other side effects.

Patching to backport it has only taken about twice the time cost (so far!)
from problems caused by not having -A.

12 years agobisect-runner.pl now patches another 5.004-era build busting bug.
Nicholas Clark [Fri, 28 Oct 2011 11:28:31 +0000 (13:28 +0200)]
bisect-runner.pl now patches another 5.004-era build busting bug.

A missing comma in perl.c breaks about 50 revisions between 2a92aaa05aa1acbf
and 8490252049bf42d3^.

12 years agoIn bisect-runner.pl, make the code to report patching errors more robust.
Nicholas Clark [Fri, 28 Oct 2011 11:02:10 +0000 (13:02 +0200)]
In bisect-runner.pl, make the code to report patching errors more robust.

Previously it was relying on matching an optional part of the patch to get
the name of the file. Now it matches a mandatory part of the patch to get it.

12 years agoIn bisect-runner.pl, refactor the code to extract previous versions of files.
Nicholas Clark [Fri, 28 Oct 2011 10:35:29 +0000 (12:35 +0200)]
In bisect-runner.pl, refactor the code to extract previous versions of files.

All code to execute variants of git show is now abstracted into subroutines.

12 years agoIn bisect-runner.pl, refactor the code that applies and reverts commits.
Nicholas Clark [Fri, 28 Oct 2011 10:12:03 +0000 (12:12 +0200)]
In bisect-runner.pl, refactor the code that applies and reverts commits.

This makes it clearer when it is applying or reverting entire commits from
git, distinct from arbitrary system calls, or arbitrary patches.

12 years agoIn bisect-runner.pl, refactor the code that opens and closes file handles.
Nicholas Clark [Fri, 28 Oct 2011 08:42:28 +0000 (10:42 +0200)]
In bisect-runner.pl, refactor the code that opens and closes file handles.

Can't use autodie, as this code needs to be able to run with the system perl
alone, and autodie wasn't added until 5.10.1. Also, the approach taken here
provides the filename in the error message for a failed close.

12 years agoallow for 2Gb+ memory allocations on 64-bit Win32 debug builds
Tony Cook [Fri, 28 Oct 2011 10:19:48 +0000 (21:19 +1100)]
allow for 2Gb+ memory allocations on 64-bit Win32 debug builds

long is 32-bit for the 64-bit Win32 memory model, so use the more
portable SSize_t.

Before the change:

C:\Users\tony\dev\perl\git\perl>perl -e "open my $f, 'dir |' or die; $x = ''; re
ad($f, $x, 4, 0x80000000)"
panic: realloc at -e line 1.

and after:

C:\Users\tony\dev\perl\git\perl>perl -e "open my $f, 'dir |' or die; $x = ''; re
ad($f, $x, 4, 0x80000000)"

C:\Users\tony\dev\perl\git\perl>git add util.c

12 years agoUpdate CPANPLUS-Dist-Build to CPAN version 0.60
Chris 'BinGOs' Williams [Thu, 27 Oct 2011 21:49:07 +0000 (22:49 +0100)]
Update CPANPLUS-Dist-Build to CPAN version 0.60

  [DELTA]

  0.60 Thu Oct 27 20:54:22 BST 2011
    - Eliminate the need to use 'perlwrapper' at all by using
      an equivalent one-liner.

12 years agoUpdate HTTP-Tiny to CPAN version 0.016
Chris 'BinGOs' Williams [Thu, 27 Oct 2011 21:45:21 +0000 (22:45 +0100)]
Update HTTP-Tiny to CPAN version 0.016

  [DELTA]

  0.016     2011-10-26 23:05:50 America/New_York

  [BUG FIXES]

  - Fixed Perl 5.6 compatibility by emulating utf8::encode [David Golden]

12 years agoAdd Mark A. Stratman to AUTHORS
Father Chrysostomos [Thu, 27 Oct 2011 21:37:43 +0000 (14:37 -0700)]
Add Mark A. Stratman to AUTHORS

12 years agoperlootut.pod: Removed redundant sentence
Mark A. Stratman [Wed, 21 Sep 2011 19:46:28 +0000 (14:46 -0500)]
perlootut.pod: Removed redundant sentence

12 years agoStop csh_glob from reading past end of string
Father Chrysostomos [Thu, 27 Oct 2011 21:31:13 +0000 (14:31 -0700)]
Stop csh_glob from reading past end of string

It was reading one byte too far, and looking at the trailing null.
This happened only in the case of an unmatched quote.

12 years agoMake csh_glob remove quote-escaping backslashes
Father Chrysostomos [Thu, 27 Oct 2011 21:26:15 +0000 (14:26 -0700)]
Make csh_glob remove quote-escaping backslashes

This commit does not change the output on Unix.  On Windows, where the
globbing engine does not usually treat backslashes as escapes, this
restores the behaviour to what it was before commit 0b0e6d70, for
cases like glob('a\"b c\"d').

Before 0b0e6d70, the preprocessing done by csh_glob (which it out-
sourced to Text::ParseWords) would remove backslash escapes, so the
globbing engine got to see a"b and c"d.

Since 0b0e6d70, the backslash escapes were no longer removed (because
in most cases they needed to remain, to avoid backslashitis), so the
globbing engine got to see a\"b and c\"d.  On Unix that made no dif-
ference, as the globbing engine treats \ as an escape character.  But
on Windows it doesn’t usually, so the output changed and produced a
literal a\"b.

This commit strips out quote-escaping backslashes in the prepro-
cessing code.

12 years agoperlrebackslash: too grammer tweaks
Father Chrysostomos [Thu, 27 Oct 2011 20:36:45 +0000 (13:36 -0700)]
perlrebackslash: too grammer tweaks

12 years agoDeparse CORE::do
Father Chrysostomos [Thu, 27 Oct 2011 16:29:26 +0000 (09:29 -0700)]
Deparse CORE::do

12 years agoDeparse CORE::glob
Father Chrysostomos [Thu, 27 Oct 2011 16:27:19 +0000 (09:27 -0700)]
Deparse CORE::glob

12 years agoIncrease $B::Deparse::VERSION to 1.09
Father Chrysostomos [Thu, 27 Oct 2011 15:42:20 +0000 (08:42 -0700)]
Increase $B::Deparse::VERSION to 1.09

12 years agoPATCH: [perl #99928] Document that is not a bug
Karl Williamson [Thu, 27 Oct 2011 16:18:34 +0000 (10:18 -0600)]
PATCH: [perl #99928] Document that is not a bug

After consulting with Tom Christiansen, we decided that this is not a
bug.  The CR-LF sequence is considered a unit by Unicode, and so should
be inseperable, even when separating the two would cause a pattern to
match that otherwise fails.

12 years agoPATCH: [perl #101970] /[[:lower:]]/i matches upper case
Karl Williamson [Thu, 27 Oct 2011 15:39:11 +0000 (09:39 -0600)]
PATCH: [perl #101970] /[[:lower:]]/i matches upper case

This bug is a regression in 5.14, in which /[[:lower:]]/i and
/[[:upper:]]/i no longer matched the opposite case.

The fix is to have these use a different table under /i matching, that
includes the correct /i code points.  These tables were already
available, just unused.

12 years agoregcomp.c: Don't prefix posix props with Is
Karl Williamson [Thu, 27 Oct 2011 16:31:02 +0000 (10:31 -0600)]
regcomp.c: Don't prefix posix props with Is

When confronted with something like [[:alpha:]], regcomp.c adds
IsPosixAlpha to the list of properties for code points above 255 to
match against when executing the pattern.  The 'Is' is extraneous, and
future commits will not want it.

12 years agoMinor usability improvements to bisect.pl
Nicholas Clark [Thu, 27 Oct 2011 14:55:53 +0000 (16:55 +0200)]
Minor usability improvements to bisect.pl

* Canonicalise the start and end commit-ish to actual commits before changing
  what is checked out. This allows one to use HEAD for either.
* For git 1.6.6 and later, use git bisect reset HEAD to avoid one change of
  what is checked out
* Sanity test the end revision before the start revision (or the search for a
  start revision), as one compile of the end revision is likely to be faster
  than the search (particularly if the search fails), hence on average any
  problems will be reported earlier.

12 years agobisect-runner.pl needs to work around an OpenBSD/sparc compiler bug.
Nicholas Clark [Thu, 27 Oct 2011 14:18:17 +0000 (16:18 +0200)]
bisect-runner.pl needs to work around an OpenBSD/sparc compiler bug.

OpenBSD 4.6 has a sparc compiler bug that prevents building perl-5.8.0.
Work around this, as bisect.pl assumes that it can build all stable .0
releases.

12 years agoIn bisect-runner.pl, add -L/usr/local/lib in a non-OS-specific way.
Nicholas Clark [Thu, 27 Oct 2011 14:14:23 +0000 (16:14 +0200)]
In bisect-runner.pl, add -L/usr/local/lib in a non-OS-specific way.

It's not scalable to hack the hints file on an OS by OS basis to add
-L/usr/local/lib to ldflags, given that in reality any OS will need it, if
it happens to have "wanted" libraries installed in /usr/local. So apply
the relevant logic that deals with this in perl-5.001n's Configure to earlier
versions of Configure.

With this, we can remove the special case to add -L/usr/local/lib for
FreeBSD, and avoid writing similar code for OpenBSD.

12 years agoFile::Glob: short-circuit earlier for list cx
Father Chrysostomos [Thu, 27 Oct 2011 07:28:02 +0000 (00:28 -0700)]
File::Glob: short-circuit earlier for list cx

For <...> without spaces in list context, don’t even bother adding
file names returned by the glob engine to the cached array.  I origin-
ally added a short-circuit that would skip copying the file names from
the cached array on to the stack in that case, because the file names
are already there.  But we can also skip putting them in the array to
begin with, as the cached array is about to be deleted.

This should make things even faster.

12 years agoFile::Glob: Eliminate the doglob alias to bsd_glob
Father Chrysostomos [Thu, 27 Oct 2011 06:48:27 +0000 (23:48 -0700)]
File::Glob: Eliminate the doglob alias to bsd_glob

I’m referring here to CVs, not C functions.

Actually, bsd_glob is the alias to doglob.  doglob is no longer
called, as of commit 1bb8785ab1.  So this commit is actually renaming
doglob to bsd_glob and removing the alias.

12 years agoSkip <~> test on VMS
Father Chrysostomos [Thu, 27 Oct 2011 06:35:55 +0000 (23:35 -0700)]
Skip <~> test on VMS

12 years agoMake dual-life.t emit full paths
Father Chrysostomos [Thu, 27 Oct 2011 01:12:23 +0000 (18:12 -0700)]
Make dual-life.t emit full paths

When it fails, this makes it easier to see why.

12 years agoTweak dual-life.t’s exclusion list
Father Chrysostomos [Thu, 27 Oct 2011 01:10:25 +0000 (18:10 -0700)]
Tweak dual-life.t’s exclusion list

to ignore ../cpan/Module-Build/MB-gADHN4rt/Simple/bin/foo

(without a .PL extension)

12 years agoTest $x=wait under arybase
Father Chrysostomos [Thu, 27 Oct 2011 01:05:25 +0000 (18:05 -0700)]
Test $x=wait under arybase

12 years agoarybase.xs: Always check the op type in ck_*
Father Chrysostomos [Thu, 27 Oct 2011 01:02:58 +0000 (18:02 -0700)]
arybase.xs: Always check the op type in ck_*

Sometimes the previous check function will have replaced the op
with one of a different type.  In that case, the rest of arybase’s
check function does not apply and can even cause a crash for ops
with no children (e.g., $x=wait is optimised down to a simple wait
op with no children and with op_targ pointing to $x, if it is
lexical).

12 years agoarybase.xs: Remove extraneous semicolon
Father Chrysostomos [Thu, 27 Oct 2011 00:56:32 +0000 (17:56 -0700)]
arybase.xs: Remove extraneous semicolon

12 years agoRemove arybase’s Makefile.PL
Father Chrysostomos [Wed, 26 Oct 2011 22:14:12 +0000 (15:14 -0700)]
Remove arybase’s Makefile.PL

It only existed to work around an ExtUtils::MakeMaker problem that is
now fixed

12 years agoFix CORE::glob
Father Chrysostomos [Wed, 26 Oct 2011 00:56:32 +0000 (17:56 -0700)]
Fix CORE::glob

This commit makes CORE::glob bypassing glob overrides.

A side effect of the fix is that, with the default glob implementa-
tion, undefining *CORE::GLOBAL::glob no longer results in an ‘unde-
fined subroutine’ error.

Another side effect is that compilation of a glob op no longer assumes
that the loading of File::Glob will create the *CORE::GLOB::glob type-
glob.  ‘++$INC{"File/Glob.pm"}; sub File::Glob::csh_glob; eval '<*>';’
used to crash.

This is accomplished using a mechanism similar to lock() and
threads::shared.  There is a new PL_globhook interpreter varia-
ble that pp_glob calls when there is no override present.  Thus,
File::Glob (which is supposed to be transparent, as it *is* the
built-in implementation) no longer interferes with the user mechanism
for overriding glob.

This removes one tier from the five or so hacks that constitute glob’s
implementation, and which work together to make it one of the buggiest
and most inconsistent areas of Perl.

12 years agoRewrite csh_glob in C; fix two quoting bugs
Father Chrysostomos [Tue, 25 Oct 2011 22:40:40 +0000 (15:40 -0700)]
Rewrite csh_glob in C; fix two quoting bugs

This commit rewrites File::Glob::csh_glob (which implements perl’s
default globbing behaviour) in C.

This fixes a problem introduced by 0b0e6d70f.  If there is an
unmatched quotation mark, all attempts to parse the pattern are
discarded and it is treated as a single token.  Prior to 0b0e6d70f,
whitespace was stripped from both ends in that case.  As of 0b0e6d70f,
it was only stripped from the beginning.  This commit restores the
pre-0b0e6d70f behaviour with unmatched quotes.  It doesn’t take
'a"b\ ' into account (where the space is escaped), but that wasn’t
handled properly before 0b0e6d70f, either.

This also finishes making csh_glob consistent with regard to quota-
tion marks.  Commit 0b0e6d70f attempted to do that, but did not strip
out medial quotation marks, as in a"b"c.  Text::ParseWords does not
provide an interface for stripping out quotation marks but leaving
backslashes, which I tried to work around, not fully understanding
the implications.  Anyway, this new C implementation doesn’t use
Text::ParseWords.

The latter fix caused a test failure, but that test was there to make
sure the behaviour didn’t change depending on whether File::Glob
was loaded before the first mention of glob().  (In 5.6, loading
File::Glob first would make perl revert to external csh glob, ironic-
ally enough.)  This commit modifies the test to test for sameness,
rather than exact output.  In fact, this change causes perl and
miniperl to be consistent, and probably also causes glob to be more
consistent across platforms (think of VMS).

Another effect of the translation to C is that the Unicode Bug is
fixed with regard to splitting patterns.  The C code effectively does
/\s/a now (which I believe is the only sane behaviour in this case),
instead of treating the string differently depending on the UTF8 flag.
The Unicode Bug is still present with regard to actual globbing.

This commit introduces one regression.  This code:

    undef %File::Glob::;
    glob("nometachars");

will no longer return anything, because csh_glob no longer holds a
reference count on the $File::Glob::DEFAULT_FLAGS glob.  Any code that
does that is beyond crazy.

The big advantage to this patch is speed.  Something like
‘@files = <*>’ is 18% faster in a folder of 300 files.  For smaller
folders there should be an even more notable difference.

12 years agoSpeed up csh_glob
Father Chrysostomos [Tue, 25 Oct 2011 05:27:48 +0000 (22:27 -0700)]
Speed up csh_glob

If it’s not going to be using the pattern at all (due to iteration),
there is absolutely no point in parsing it.

This will speed up CORE::glob and <...> as well, since they use
csh_glob by default.

12 years agoUpdate HTTP-Tiny to CPAN version 0.015
Chris 'BinGOs' Williams [Wed, 26 Oct 2011 20:50:55 +0000 (21:50 +0100)]
Update HTTP-Tiny to CPAN version 0.015

  [DELTA]

  0.015     2011-10-26 16:42:26 America/New_York

  [BUG FIXES]

  - Make sure PERL_UNICODE doesn't affect PUT test data [Tony Cook]

  [DOCUMENTATION]

  - Fixed typo

12 years agobisect-runner.pl can now build all revisions on sparc64 Linux.
Nicholas Clark [Wed, 26 Oct 2011 21:19:39 +0000 (23:19 +0200)]
bisect-runner.pl can now build all revisions on sparc64 Linux.

test_prep back to 5.001n, miniperl back to 5.000, for both 32 and 64 bit.
This requires backporting tweaks to the Linux hints file, and patching
early Configure to detect byteorder correctly as 87654321 when using
linker flags to build 64 bit.

12 years agobisect-runner.pl should patch unreliable C symbol detection code.
Nicholas Clark [Wed, 26 Oct 2011 21:17:58 +0000 (23:17 +0200)]
bisect-runner.pl should patch unreliable C symbol detection code.

Fix Configure's symbol detection to that of commit 373dfab3839ca168 if it's
any intermediate version 5129fff43c4fe08c or later, as the intermediate
versions don't work correctly on (at least) Sparc Linux.

12 years agobisect-runner.pl now patches several build-busting-bugs between 5.004 & 5.005
Nicholas Clark [Wed, 26 Oct 2011 21:08:28 +0000 (23:08 +0200)]
bisect-runner.pl now patches several build-busting-bugs between 5.004 & 5.005

This significantly reduces the number of "skip" revisions between 5.004 and
5.005, at worst speeding up bisects for problems which originate at this
time, at best permitting git bisect to locate the actual commit, instead of
a range of "skip"s.

12 years agobisect-runner.pl now copes when historical MANIFEST files list directories.
Nicholas Clark [Wed, 26 Oct 2011 21:02:06 +0000 (23:02 +0200)]
bisect-runner.pl now copes when historical MANIFEST files list directories.

It had assumed that MANIFEST only listed files, which caused its
'force-manifest' code to choke on revisions between 27332437a2ed1941 and
bf3d9ec563d25054^ inclusive, as manifest contains ext/Thread/Thread

12 years agoUpdate ExtUtils-MakeMaker to CPAN version 6.63_01
Chris 'BinGOs' Williams [Wed, 26 Oct 2011 19:10:05 +0000 (20:10 +0100)]
Update ExtUtils-MakeMaker to CPAN version 6.63_01

  [DELTA]

  6.63_01  Sun Oct 23 16:57:24 PDT 2011
    Bug Fixes
    * Stray $ in the PPD and meta files (for example, from the ABSTRACT)
      are now escaped.  [rt.cpan.org 71847]

    Possibly incompatible changes
    * echo() now escapes all dollar signs by default

    New Features
    * echo() has an option to allow make variable expansion.
    * echo() is now passed a hash of options (old style $appending flag
      still works for compatibility).
    * quote_literal() now escapes dollar signs, but allows make variables.
    * quote_literal() has an option to escape make variables.
    * escape_dollarsigns() to escape dollar signs but allow variables
    * escape_all_dollarsigns() to escape all dollar signs

    Improvements
    * The PPD VERSION is now derived from the VERSION variable in the Makefile
      rather than hard coded.

    Bundled Modules
    * Updated CPAN::Meta to 2.112621
    * Updated CPAN::Meta::YAML to 0.004
    * Updated JSON::PP to 2.27200

  6.62  Sun Oct 23 16:43:36 PDT 2011
    No changes from 6.61_01