This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
8 years agoperl.h: White-space only
Karl Williamson [Thu, 19 Mar 2015 19:28:30 +0000 (13:28 -0600)]
perl.h: White-space only

Remove some empty /**/ and align line continuation backslashes onto tab
boundaries

8 years agoChange some locale manipulation macros in prep for API
Karl Williamson [Thu, 19 Mar 2015 19:06:27 +0000 (13:06 -0600)]
Change some locale manipulation macros in prep for API

This changes the way some of the current internal-only macros are named
and used in order to simplify things and minimize what gets exposed as
part of the API.

Although these have not been listed as publicly available, it costs
essentially nothing to keep the old names around in case someone was
illegally using them.

8 years agoregen/regcharclass.pl: Need to rebuild when source files change
Karl Williamson [Thu, 19 Mar 2015 17:23:58 +0000 (11:23 -0600)]
regen/regcharclass.pl: Need to rebuild when source files change

Like regen/mk_invlists.pl, if any of various Unicode-related files
change, we can't rely on the generated file remaining unchanged.

8 years agoregen/mk_invlists.pl depends on mktables
Karl Williamson [Thu, 19 Mar 2015 17:05:50 +0000 (11:05 -0600)]
regen/mk_invlists.pl depends on mktables

If mktables changes, the input data for this may also change.

8 years agoregen/mk_invlists.pl: Don't quit so easily
Karl Williamson [Fri, 13 Mar 2015 18:20:18 +0000 (12:20 -0600)]
regen/mk_invlists.pl: Don't quit so easily

Like the previous commit, this script may be called before mktables.lst
exists, and we can't generate mktables.lst without this script
executing to completion.  The missing file is only used to determine if
something has changed that we would need to recompile for so this script
can run faster next time it is called.

8 years agoregen/regen_lib.pl: Don't die on missing digest
Karl Williamson [Fri, 13 Mar 2015 18:06:40 +0000 (12:06 -0600)]
regen/regen_lib.pl: Don't die on missing digest

regen_lib now has the capability of calculating a digest for various
files passed to it, and saving those values in the generated output
file.  The passed in files are supposed to be the sources of the
generated file, so that on future regen runs, if no digest value has
changed, there should be no need to actually do the (potentially slow)
regen.

When bootstrapping up a perl, not everything may have been built before
a regen is attempted.  This was dieing under those conditions,
preventing the build from happening.  Thus we come to a dead-end.

This commit causes a random digest to be generated for a source file
that doesn't (yet) exist, instead of dieing.  That means that the build
can continue, and the source should be generated at some point in
it.  The random digest is not going to match the real one, so the next
time the regen happens, it will signal that things need to be rebuilt,
and then the actual digest of the source will be calculated and
stored.

Having the fake digest be a random number makes sure that, should the
missing file remain missing, that the regen will continue to rebuild
things each time.  So, if someone carelessly commits the result without
realizing there is an empty source, the Porting tests will fail, drawing
attention to the problem.

8 years agoUpgrade parent from version 0.228 to 0.232
Steve Hay [Thu, 19 Mar 2015 21:09:42 +0000 (21:09 +0000)]
Upgrade parent from version 0.228 to 0.232

8 years agolib/perl5db.pl: Fix pod typo
Karl Williamson [Thu, 19 Mar 2015 16:07:38 +0000 (10:07 -0600)]
lib/perl5db.pl: Fix pod typo

8 years agolib/perl5db.pl: Generalize for EBCDIC
Karl Williamson [Sun, 15 Mar 2015 03:50:49 +0000 (21:50 -0600)]
lib/perl5db.pl: Generalize for EBCDIC

8 years agoCreate single fcn for dup'd /lib code
Karl Williamson [Sun, 15 Mar 2015 03:50:27 +0000 (21:50 -0600)]
Create single fcn for dup'd /lib code

Several /lib .pm's have the same code which is complicated enough to
warrant being placed in a shared function.  This commit creates a .pm
to be used by these .pm's.

This implements the perhaps archaic 'Meta' notation wherein characters
above 0x7f are displayed as M- plus the ASCII-range character derived by
looking at only the lower 7 bits of the upper range one.  There are
problems with this, in that a literal control character can be in the
string, whereas it is trying to get rid of control characters.  But I
left it to work as-is, just centralizing the code.

On EBCDIC platforms this notation makes no sense because the bit
patterns are all mixed up about having the upper bit set.  So this
commit fixes things on these platforms, so these are changed to
\x{...}.  No literal control characters are emitted.

Another potential problem is that characters above 0xFF are passed
through, unchanged.  But again, I let the existing behavior stand.

8 years agoChange name of mro.c
Karl Williamson [Mon, 16 Mar 2015 17:14:12 +0000 (11:14 -0600)]
Change name of mro.c

This is to prevent a conflict showing up on z/OS (os390) because this
file's name is the same as one in /ext, and there are functions
cross-referenced between them, and the loader on that platform
can't deal with this.

See http://nntp.perl.org/group/perl.perl5.porters/226612

8 years agodbmopen() with a third argument of undef can create files on disk.
Nicholas Clark [Tue, 17 Mar 2015 14:25:02 +0000 (15:25 +0100)]
dbmopen() with a third argument of undef can create files on disk.

Hence we need to ensure that they are cleaned up.

8 years agoFix rendering of this code snippet in 'perldoc -f chomp'
Karen Etheridge [Thu, 19 Mar 2015 02:13:56 +0000 (19:13 -0700)]
Fix rendering of this code snippet in 'perldoc -f chomp'

In text, formerly rendered as:  ("$/ = """)
Now rendered as: ("$/ = ''") which is a tad less confusing

8 years agot/re/pat_re_eval.t: Skip encoding tests on EBCDIC
Karl Williamson [Wed, 18 Mar 2015 21:56:48 +0000 (15:56 -0600)]
t/re/pat_re_eval.t: Skip encoding tests on EBCDIC

These require changes to Encode which are not planned
to be put in v5.22

8 years agot/op/pack.t: Generalize for EBCDIC
Karl Williamson [Thu, 4 Apr 2013 03:56:02 +0000 (21:56 -0600)]
t/op/pack.t: Generalize for EBCDIC

There are still a few failures that are skipped and should be looked at
in v5.23.

8 years agosmartmatch: handle stack realloc
David Mitchell [Wed, 18 Mar 2015 17:06:49 +0000 (17:06 +0000)]
smartmatch: handle stack realloc

When smartmatch is matching a pattern against something, it was
failing to do appropriate PUTBACK and SPAGAIN's  before calling
matcher_matches_sv() (which pushes an arg an calls pp_match()).
If the stack was almost full, the extra push in matcher_matches_sv()
could cause a stack realloc, which would then be ignored when
pp_smartmatch() returned, setting PL_stack_sp to point to the old (freed)
stack.

Adding SPAGAIN ensures that PL_stack_sp points to the new stack, while
PUTBACK causes PL_stack_sp to no longer see the two args to pp_smartmatch,
so the PUSH in matcher_matches_sv() pushes the SV us9ng ones of two two
reclaimed slots, so the stack won't re-alloc anyway.

Thus by doing the "right thing" with both PUTBACK and SPAGAIN, we
doubly ensure that PL_stack_sp will always be right.

8 years agoupdate PL_stack_sp when we exit matcher_matches_sv()
Tony Cook [Thu, 19 Feb 2015 04:03:58 +0000 (15:03 +1100)]
update PL_stack_sp when we exit matcher_matches_sv()

8 years agoTODO test for smartmatch stack issue
Tony Cook [Thu, 19 Feb 2015 04:02:49 +0000 (15:02 +1100)]
TODO test for smartmatch stack issue

8 years agorepeat op: avoid integer overflows
David Mitchell [Wed, 11 Mar 2015 12:25:58 +0000 (12:25 +0000)]
repeat op: avoid integer overflows

For the list variant of the x operator, the overflow detection code
doesn't always work, resulting in the stack not being extended enough.

There are two places where an overflow could occur: calculating how
many stack items to extend by (items * count), and passing to repeatcpy()
how many bytes to copy 'items' SV pointers (items * sizeof(const SV *)).

The overflow detection was generally a mess; checking for overflow
using a value (max) that may have already overflown; checking whether
'max' had overflown incorrectly, and not checking (items * sizeof(const SV
*) at all (perhaps hoping that the other checks would be a superset of
this).

Also, some of the vars were still I32s; promote to 64-bit capable types.

Finally, the signature of Perl_repeatcpy() still has an I32 len;
that really should be changed to IV at some point; but for now I've just
ensured that the callers (list 'x' and scalar 'x') don't wrap.
I haven't put in a check for the only other core caller of repeatcpy(),
S_study_chunk(), since that would only become an issue compiling a pattern
with a fixed or floating substr within it of length > 2**31.

8 years agoop.c: rename CHANGE_TYPE() to OpTYPE_set()
David Mitchell [Thu, 19 Mar 2015 11:04:01 +0000 (11:04 +0000)]
op.c: rename CHANGE_TYPE() to OpTYPE_set()

This macro is private to op.c, and has an overly generic name.

8 years agouniversal.c: remove all trace of op_sibling
David Mitchell [Thu, 19 Mar 2015 10:02:00 +0000 (10:02 +0000)]
universal.c: remove all trace of op_sibling

The OpSIBLING() macro and op_sibling_splice() are a higher-level
way of manipulating optrees that ensure portability in the face of
PERL_OP_PARENT etc.

This commit also helps with the lofty goal of nothing outside of op.c
directly accessing the op_sibling field.

This is a follow-on/improvement to bac7a184cda7b.

8 years agoperlguts: clarify op_sibling usage
David Mitchell [Thu, 19 Mar 2015 09:49:14 +0000 (09:49 +0000)]
perlguts: clarify op_sibling usage

8 years agouniversal.c: PERL_OP_PARENT support
Father Chrysostomos [Thu, 19 Mar 2015 04:56:46 +0000 (21:56 -0700)]
universal.c: PERL_OP_PARENT support

8 years ago[perl #123995] Assert fail with s;@{<<;
Father Chrysostomos [Wed, 18 Mar 2015 09:35:50 +0000 (02:35 -0700)]
[perl #123995] Assert fail with s;@{<<;

If s;; gobbles up the implicit semicolon that is tacked on to the end
of the file, it can confuse the here-doc parser into thinking it is
inside a string eval, because there is no file handle.  We need to
check for that possibility where the assertion was failing.

8 years agoregcomp.c: White-space only
Karl Williamson [Tue, 17 Mar 2015 23:28:24 +0000 (17:28 -0600)]
regcomp.c: White-space only

Outdent code that the previous commit removed the surrounding block from

8 years agoFix qr'\N{U+41}' on EBCDIC platforms
Karl Williamson [Tue, 17 Mar 2015 04:38:20 +0000 (22:38 -0600)]
Fix qr'\N{U+41}' on EBCDIC platforms

Prior to this commit, the regex compiler was relying on the lexer to do
the translation from Unicode to native for \N{...} constructs, where it
was simpler to do.  However, when the pattern is a single-quoted string,
it is passed unchanged to the regex compiler, and did not work.  Fixing
it required some refactoring, though it led to a clean API in a static
function.

This was spotted by Father Chrysostomos.

8 years agodoc typo
Hugo van der Sanden [Wed, 18 Mar 2015 21:58:43 +0000 (21:58 +0000)]
doc typo

8 years agoperlrebackslash: Clarify that \b{} rules are volatile
Karl Williamson [Wed, 18 Mar 2015 19:25:54 +0000 (13:25 -0600)]
perlrebackslash: Clarify that \b{} rules are volatile

8 years agodist/Data-Dumper/t/dumper.t: White space only
Karl Williamson [Wed, 18 Mar 2015 17:27:34 +0000 (11:27 -0600)]
dist/Data-Dumper/t/dumper.t: White space only

The previous commit removed a surrounding block.  outdent
correspondingly

8 years agodist/Data-Dumper/t/dumper.t: Simplify EBCDIC
Karl Williamson [Fri, 13 Mar 2015 05:03:17 +0000 (23:03 -0600)]
dist/Data-Dumper/t/dumper.t: Simplify EBCDIC

This collapses two pieces of code into one.  It isn't necessary to have
an ASCII version vs an EBCDIC version.

8 years agoTerm::Complete: Generalize for EBCDIC
Karl Williamson [Fri, 27 Jun 2014 22:31:41 +0000 (16:31 -0600)]
Term::Complete: Generalize for EBCDIC

By this simple change, we can avoid printing all controls except \c?.
On ASCII platforms the remaining control is DEL, which is handled above.
On EBCDIC platforms, \c? remains a problem.

But it isn't clear what to do about this anyway, as the module
interprets ^D, ^H, ^U specially as if they were typed from the keyboard,
and expects the keyboard to transmit them in a particular way, which may
not be valid for EBCDIC.  No tests fail, so fixing this will have to
wait for tuits or field complaints.

8 years agolib/open.t: TODO an EBCDIC test until Encode fixed
Karl Williamson [Mon, 2 Mar 2015 23:06:47 +0000 (16:06 -0700)]
lib/open.t: TODO an EBCDIC test until Encode fixed

8 years agoDBM_Filter/t/encode.t: temporarily skip until Encode fixed
Karl Williamson [Tue, 3 Mar 2015 05:07:45 +0000 (22:07 -0700)]
DBM_Filter/t/encode.t: temporarily skip until Encode fixed

8 years agoporting/readme.t: TODO failing EBCDIC test
Karl Williamson [Tue, 3 Mar 2015 04:31:07 +0000 (21:31 -0700)]
porting/readme.t: TODO failing EBCDIC test

This depends on Unicode::Collate, which is not yet working properly in
EBCDIC

8 years agoext/SDBM_File/sdbm/dbu.c Generalize for EBCDIC platforms
Karl Williamson [Sun, 7 Dec 2014 06:08:38 +0000 (23:08 -0700)]
ext/SDBM_File/sdbm/dbu.c Generalize for EBCDIC platforms

This also fixed a bug which hasn't shown up in the tests, in that it
uses 'char' where it should be 'U8'.

8 years agoregexec.c: Fix improper warning.
Karl Williamson [Wed, 18 Mar 2015 04:03:16 +0000 (22:03 -0600)]
regexec.c: Fix improper warning.

\b{} and \B{} are valid in UTF-8 locales, as all the Unicode rules
apply.  Prior to this patch a warning was raised under some
circumstances.  The warning text was generalized to handle both \b and
\B cases.  The original text was only just added, in 5.21.9.

8 years agore/pat_advanced.t: Tighten test
Karl Williamson [Mon, 16 Mar 2015 21:52:18 +0000 (15:52 -0600)]
re/pat_advanced.t: Tighten test

This adds anchors to a pattern.  I discovered while changing things that
it still passed when broken

8 years agoregcomp.sym: Update \b descriptions
Karl Williamson [Tue, 17 Mar 2015 22:56:34 +0000 (16:56 -0600)]
regcomp.sym: Update \b descriptions

8 years agoPATCH: [perl #124091] PP Data::Dumper fails on \n isolate
Karl Williamson [Tue, 17 Mar 2015 21:44:03 +0000 (15:44 -0600)]
PATCH: [perl #124091] PP Data::Dumper fails on \n isolate

Commit 31ac59b61698e704b64192de74793793f4b5b0c0 inadvertently changed
the behavior of the pure perl version of Data::Dumper.  If a newline is
the sole character in something being dumped with useqq, it no longer
got translated into a \n sequence and was output raw.  This was due to
the regex matching of \n at beginning and ends of strings.

8 years agot/op/dump.t: silence 'Aborted' messages on stderr
David Mitchell [Wed, 18 Mar 2015 14:10:33 +0000 (14:10 +0000)]
t/op/dump.t: silence 'Aborted' messages on stderr

On some platforms, t/op/dump.t produces extraneous (and scary)

    sh: line 1: 17605 Aborted (core dumped)

style messages on stderr.

Do a fork in each test to avoid this.

8 years agoCwd.xs: silence recent compiler warning
David Mitchell [Wed, 18 Mar 2015 12:08:07 +0000 (12:08 +0000)]
Cwd.xs: silence recent compiler warning

A recent commit added a label, plus a "goto that label" only in the EBCDIC
case. On "normal" builds, the compiler complained about an unused label.

Also, indent the recent '#ifdef EBCDIC' correctly.

8 years agoS_grok_bslash_[ox]: assert char fits
David Mitchell [Wed, 18 Mar 2015 11:53:23 +0000 (11:53 +0000)]
S_grok_bslash_[ox]: assert char fits

S_grok_bslash_o() and S_grok_bslash_x() scan \o{...} and \x{...} in a
string, and return a UV codepoint. Some callers assume that if that
codepoint is converted into a series of utf8 bytes and re-inserted into
the string, that it will tale up less space than the original "\x{...}"
sequence. Add asserts that this is indeed so.

8 years agoloopctl.c: Correct bug num
Father Chrysostomos [Wed, 18 Mar 2015 06:17:48 +0000 (23:17 -0700)]
loopctl.c: Correct bug num

8 years ago[perl #124004] Fix stack bug with foreach(@empty)
Father Chrysostomos [Wed, 18 Mar 2015 05:40:25 +0000 (22:40 -0700)]
[perl #124004] Fix stack bug with foreach(@empty)

The context gets recorded on the context stack when a loop is entered.
That context is then used at loop exit when handling the stack.

In the case of foreach, the context applied to the stack was taken
from the enteriter op.  But the enteriter op was always getting list
context applied.  That meant that foreach(@empty_array){} in scalar
context would push nothing on to the stack, causing a subsequent stack
read to look one item too far to the left, either reading the wrong
thing, or causing a stack underflow (even a crash).  The clearest bug
resulting from it:

$ ./miniperl -le 'push @_, 1, 2, 3, scalar do { for(@x){} } + 1, 4, 5, 6; print "@_"'
1 2 4 4 5 6

instead of 1 2 3 1 4 5 6.

We do need to apply list context to make sure the items iterated over
are evaluated in list context.  But we need to apply it *only* to
those (expr in newFOROP), not the the outer enteriter op.  That op’s
context should be left unset here, so that the calling context will be
applied to it.

This bug goes back at least to perl 5.000.

8 years agoRemove PL_ prefix for recently added non-globals
Karl Williamson [Fri, 13 Mar 2015 17:54:46 +0000 (11:54 -0600)]
Remove PL_ prefix for recently added non-globals

PL is reserved for global variables.  These are enums and static
variable names introduced for handling /\b{...}/

See <20150311150610.GN28599@iabyn.com> and follow up.

8 years agoPreserve OPTIMIZE in hints
Vincent Pit [Tue, 17 Mar 2015 17:06:16 +0000 (14:06 -0300)]
Preserve OPTIMIZE in hints

Some extensions hints files (B, Digest-MD5, PerlIO-via) forcefully
overwrite OPTIMIZE in order to work around compiler mishaps with high level
optimizations. However, this loses whatever extra flags are listed in
OPTIMIZE, such as compiler warnings flags or PERL_POISON, and makes them
difficult to run under a debugger since a minimal level of optimization
(usually -O1) is always enforced. This has became visible recently with
new XS handshake facility.

Instead, we chose to just follow Storable's strategy of lowering the
optimization level with a substitution, while keeping all the other flags
untouched. If other compiler flags are deemed problematic (such as
-mcpu/-march on gcc), they ought to be addressed separately.

Only B and PerlIO-via hints files are fixed by this change. The case of
Digest-MD5 will be addressed on the CPAN.

This fixes [RT #124038].

8 years agoperldelta for previous commit
Steve Hay [Tue, 17 Mar 2015 22:36:33 +0000 (22:36 +0000)]
perldelta for previous commit

8 years agoUpgrade to threads 2.01
Jerry D. Hedden [Sun, 8 Mar 2015 02:33:02 +0000 (21:33 -0500)]
Upgrade to threads 2.01

8 years agoUpgrade CPAN::Meta from version 2.143240 to 2.150001
Steve Hay [Tue, 17 Mar 2015 22:10:34 +0000 (22:10 +0000)]
Upgrade CPAN::Meta from version 2.143240 to 2.150001

8 years agoBlead is (almost!) using Carp-1.35
Steve Hay [Tue, 17 Mar 2015 21:47:16 +0000 (21:47 +0000)]
Blead is (almost!) using Carp-1.35

8 years agoPorting/core-cpan-diff: Don't ignore EOLs or whitespace
Steve Hay [Tue, 17 Mar 2015 18:07:40 +0000 (18:07 +0000)]
Porting/core-cpan-diff: Don't ignore EOLs or whitespace

Turning off -b (ignore whitespace) revealed a whitespace difference lurking
in blead's copy of a NEXT test file, which there is no need for.
Turning on --binary revealed EOL differences in numerous Win32API-File
files. Hopefully a future CPAN release will fix those since the files in
its GitHub repo match blead as far as EOLs go already.

8 years agoRevert discouragement of fatal warnings
Ricardo Signes [Tue, 17 Mar 2015 17:28:31 +0000 (13:28 -0400)]
Revert discouragement of fatal warnings

...at least for now.

This reverts commits 0d314ba30623b19c36dfc97ac4b6ecb94cb406f4
and ce3778a3796be3e4604ed9b3671ea624c5affe0b.

8 years agoPL_custom_op{s,_names,_descs} should be set to NULL in perl_destruct().
Nicholas Clark [Tue, 17 Mar 2015 16:19:23 +0000 (17:19 +0100)]
PL_custom_op{s,_names,_descs} should be set to NULL in perl_destruct().

Otherwise SEGVs and other jollity can happen if the interpreter is created a
second (or subsequent) time, and modules attempt to register custom OPs
(using either the old or new approaches).

These appear to have been bugs since the relevant code was introduced
(new approach in v5.14.0, old approach in v5.8.0)

This probably only affects mod_perl built against a perl without ithreads,
which makes it unlikely that many folks hit it with OS distributions.

You'd need to (at least) be building your own perl, using mod_perl, and
using a module that uses custom OPs.

8 years agoavoid infinite loop in re_intuit_start()
David Mitchell [Tue, 17 Mar 2015 15:43:10 +0000 (15:43 +0000)]
avoid infinite loop in re_intuit_start()

On STCLASS failure, sometimes we go back and retry an anchored search
if it's still within the range of the previously successful floating
search. The 'in range' criterion is formally that

    rx_origin + float_offset_min chars < previous float match position

i.e. when we match the float string, the start of the rx must be somewhere
within float_offset_max..float_offset_min chars before that. If we
haven't yet reached rx_origin+float_offset_min, then there are still
some candidate starting positions for the rx that don't violate the
float constraint.

However, we do the above calculation in bytes rather than chars for
efficiency (if float_offset_min is large, we could otherwise end up doing
O^2 scans of the string). This is conservative and harmless because at
worst we end up doing an unnecessary (but safe) fixed string scan.

However, it turns out that the 'other' code block that calls fbm_instr()
didn't check for the start of scn range being greater than the end;
in this case, for '$' type matches, it would still match. So skip calling
fbm_instr() if start > end.

8 years agore_intuit_start(): improve debugging output
David Mitchell [Tue, 17 Mar 2015 13:00:29 +0000 (13:00 +0000)]
re_intuit_start(): improve debugging output

1) make string offsets be consistently counted from strbeg, rather than
   a mixture of that and strpos;
2) make it clearer when rx_origin has been updated, since that value
   is the raison d'etre of intuit();
3) always show the input and output offsets when calling fbm_intr() from
   intuit().

8 years agodist/ExtUtils-CBuilder/t/04-base.t: os390 fix
Karl Williamson [Wed, 4 Feb 2015 20:22:25 +0000 (13:22 -0700)]
dist/ExtUtils-CBuilder/t/04-base.t: os390 fix

8 years agoUpgrade Text::ParseWords from version 3.29 to 3.30
Steve Hay [Tue, 17 Mar 2015 15:05:37 +0000 (15:05 +0000)]
Upgrade Text::ParseWords from version 3.29 to 3.30

This incorporates blead's code differences, but one "customization" remains
because of EOL issues, which I've sent a pull request upstream to fix.

The latest release also moves the .pm file into the usual place, so the MAP
is no longer required.

There are no code changes here, so no code freeze violation.

8 years agoExtend Cwd to work on z/OS sysplexed systems
Karl Williamson [Tue, 3 Feb 2015 05:32:26 +0000 (22:32 -0700)]
Extend Cwd to work on z/OS sysplexed systems

On sysplexed os390 systems, the literal string "$SYSNAME" in a directory
path appears to the code to be a symbolic link to itself.  If one wants
to walk $SYSNAME/tmp, for example, one keeps recursing, adding $SYSNAMEs
on to the front of the path until our fail-safe limit is reached.  This
would like something like

$SYSNAME/$SYSNAME/.../$SYSNAME /tmp

never reaching the tmp.

What this commit does is to replace all instances of $SYSNAME/foo simply
by /foo, for all foo when $SYSNAME is a symbolic link.  Then the above
would resolve simply to /tmp.

There appears to not be a problem with the pure perl version

8 years agodist/PathTools/Cwd.xs: rename variable
Karl Williamson [Sun, 1 Feb 2015 05:13:19 +0000 (22:13 -0700)]
dist/PathTools/Cwd.xs: rename variable

'left' implies to me a direction, especially in this context where we
are parsing a path from left to right; instead it here means
'remaining', which I've renamed it to.

8 years agodist/PathTools/Cwd.xs: White-space/comment only
Karl Williamson [Thu, 29 Jan 2015 17:00:40 +0000 (10:00 -0700)]
dist/PathTools/Cwd.xs: White-space/comment only

Bring indentation style of bsd_realpath() into line with the rest of
Perl

8 years agoBump version of dist/PathTools to 3.55
Karl Williamson [Fri, 13 Mar 2015 03:05:46 +0000 (21:05 -0600)]
Bump version of dist/PathTools to 3.55

8 years agoperldelta entry for ce3778a3796be3e4604ed9b3671ea624c5affe0b.
James E Keenan [Tue, 17 Mar 2015 01:11:52 +0000 (21:11 -0400)]
perldelta entry for ce3778a3796be3e4604ed9b3671ea624c5affe0b.

Slight grammatical touch-up to cautions against FATAL warnings.

8 years agoDocument FATAL warnings as discouraged.
David Golden [Mon, 16 Mar 2015 18:55:46 +0000 (14:55 -0400)]
Document FATAL warnings as discouraged.

Discussions on p5p have reached reasonable consensus that fatal warnings are
a misfeature.

This commit marks fatal warning as "discouraged" and moves up the
related cautionary documentation to highlight the risks of using them.

For details on the many historical and current issues with fatal warning, see
http://www.nntp.perl.org/group/perl.perl5.porters/2015/01/msg225235.html

8 years agofix t/op/utf8cache.t with -DDEBUG_LEAKING_SCALARS
Reini Urban [Mon, 16 Mar 2015 10:26:23 +0000 (11:26 +0100)]
fix t/op/utf8cache.t with -DDEBUG_LEAKING_SCALARS

8 years agoperlunicode: Nit, for EBCDIC
Karl Williamson [Mon, 16 Mar 2015 04:25:12 +0000 (22:25 -0600)]
perlunicode: Nit, for EBCDIC

8 years agoperlpodspec: Generalize for EBCDIC
Karl Williamson [Mon, 16 Mar 2015 03:49:55 +0000 (21:49 -0600)]
perlpodspec: Generalize for EBCDIC

8 years ago[perl #124048] Sort and compare version numbers numerically.
Matthew Horsfall (alh) [Mon, 16 Mar 2015 14:14:11 +0000 (10:14 -0400)]
[perl #124048] Sort and compare version numbers numerically.

This fixes a case where on 5.x.10 dev versions of Perl,

  ./perl -Ilib Porting/corelist.pl cpan

would cause 'delta_from' for that version to point to itself.

8 years agopp_helem: Remove branch seemingly untaken (v2)
Steffen Mueller [Sun, 15 Mar 2015 09:50:12 +0000 (10:50 +0100)]
pp_helem: Remove branch seemingly untaken (v2)

An HV* that is not an SVt_PVHV? Maybe I don't have sufficient fantasy.
This branch goes back to 1994, so things have changed ... a bit since
then.

This is the second attempt at doing this small change since last time, I
was dumb enough to get the condition in the assert inverted. m(

Thanks to Brett for pointing that out nicely!

8 years agoCommits from no working 'encoding' in EBCDIC
Karl Williamson [Sun, 15 Mar 2015 05:00:31 +0000 (23:00 -0600)]
Commits from no working 'encoding' in EBCDIC

These are conglomerated together for convenience

8 years agolib/open.t: Skip a test on EBCDIC because of encoding
Karl Williamson [Fri, 17 Oct 2014 01:37:29 +0000 (19:37 -0600)]
lib/open.t: Skip a test on EBCDIC because of encoding

8 years agoext/PerlIO-encoding/t/encoding.t: Skip on EBCDIC
Karl Williamson [Fri, 28 Nov 2014 05:35:07 +0000 (22:35 -0700)]
ext/PerlIO-encoding/t/encoding.t: Skip on EBCDIC

encoding doesn't current work.

8 years agot/uni/chomp.t: Better explain why skipped on EBCDIC
Karl Williamson [Fri, 14 Nov 2014 03:52:23 +0000 (20:52 -0700)]
t/uni/chomp.t: Better explain why skipped on EBCDIC

8 years agoPerlIO-encoding/t/nolooping.t: Skip on EBCDIC platform
Karl Williamson [Fri, 17 Oct 2014 03:05:14 +0000 (21:05 -0600)]
PerlIO-encoding/t/nolooping.t: Skip on EBCDIC platform

8 years agot/op/concat2.t: Skip 'use encoding' test in EBCDIC
Karl Williamson [Fri, 27 Jun 2014 16:32:13 +0000 (10:32 -0600)]
t/op/concat2.t: Skip 'use encoding' test in EBCDIC

This pragma does not work on EBCDIC platforms

8 years agolib/DBM_Filter/t/encode.t: Generalize for non-ASCII platforms
Karl Williamson [Sat, 13 Apr 2013 21:54:37 +0000 (15:54 -0600)]
lib/DBM_Filter/t/encode.t: Generalize for non-ASCII platforms

This still has a failure due to Encode issues.  A future commit will
skip some failing tests until that is fixed.

8 years agoSkip testing all of /cpan on EBCDIC platforms for 5.22
Karl Williamson [Sun, 14 Apr 2013 04:04:50 +0000 (22:04 -0600)]
Skip testing all of /cpan on EBCDIC platforms for 5.22

The state of porting to EBCDIC that's going to get into 5.22 leaves many
many error lines being displayed when 'make test' is run if the /cpan
directory is included.  Reluctantly, I'm excluding these tests for 5.22.
I plan to work on either fixing or having individual skips in them in
5.23, but that is not the current state.

8 years agoCarp: skip some tests of "$qr" on older perls
Ricardo Signes [Sun, 15 Mar 2015 00:44:07 +0000 (20:44 -0400)]
Carp: skip some tests of "$qr" on older perls

On perls v5.9.5 to v5.17.0 inclusive, there's a Latin-1/utf8
length bug and sometimes a character is dropped from the end of the
regexp's stringification.

On earlier perls, there is an error related to invalid character
sequences.

Rather than carefully tease these apart, we'll skip the tests.
Thanks to Zefram for helping to identify the version range.

8 years agoCarp: correct precedence of ord and == in tests
Ricardo Signes [Sun, 15 Mar 2015 00:43:35 +0000 (20:43 -0400)]
Carp: correct precedence of ord and == in tests

8 years agoBegin updating perldelta for 5.21.10
Steve Hay [Sat, 14 Mar 2015 18:38:44 +0000 (18:38 +0000)]
Begin updating perldelta for 5.21.10

8 years agoUpgrade Encode from version 2.70 to 2.72
Steve Hay [Sat, 14 Mar 2015 11:36:15 +0000 (11:36 +0000)]
Upgrade Encode from version 2.70 to 2.72

This incorporates all current blead customizations.

8 years agodist/Data-Dumper/t/quotekeys.t: Generalize for EBCDIC
Karl Williamson [Sun, 26 Oct 2014 03:08:52 +0000 (21:08 -0600)]
dist/Data-Dumper/t/quotekeys.t: Generalize for EBCDIC

8 years agoData::Dumper/t/dumper.t: Add test
Karl Williamson [Thu, 5 Mar 2015 21:46:42 +0000 (14:46 -0700)]
Data::Dumper/t/dumper.t: Add test

This is for the special handling needed in EBCDIC

8 years agodist/Data-Dumper/t/dumper.t: Generalize for EBCDIC platforms
Karl Williamson [Fri, 13 Mar 2015 05:01:45 +0000 (23:01 -0600)]
dist/Data-Dumper/t/dumper.t: Generalize for EBCDIC platforms

8 years agoData::Dumper: Generalize for EBCDIC platforms
Karl Williamson [Wed, 13 Mar 2013 22:16:14 +0000 (16:16 -0600)]
Data::Dumper: Generalize for EBCDIC platforms

This extends Data::Dumper to work on EBCDIC platforms.  This is just the
code changes.  Some .t files will be changed as well, in future commits

This involves some code refactoring especially in the .xs code to
collapse EBCDIC/ASCII handling into one.  The if-elsif-elsif-...-else
logic is cleaned up, so that there are fewer branches taken on average.

8 years agodist/Data-Dumper/t/dumper.t: Add test names
Karl Williamson [Fri, 13 Mar 2015 04:58:40 +0000 (22:58 -0600)]
dist/Data-Dumper/t/dumper.t: Add test names

8 years agoData::Dumper/t/dumper.t: only specify number of tests once
Karl Williamson [Thu, 5 Mar 2015 21:47:16 +0000 (14:47 -0700)]
Data::Dumper/t/dumper.t: only specify number of tests once

This calculates the number of tests when some modules are unavailable,
instead of it having to be specified each time there is a change.

8 years agoData::Dumper/t/dumper.t: Remove test numbers from comments
Karl Williamson [Thu, 5 Mar 2015 21:28:49 +0000 (14:28 -0700)]
Data::Dumper/t/dumper.t: Remove test numbers from comments

These are no longer correct, and hard to maintain.  It's not worth it.

8 years agodist/Storable/t/utf8.t: Fix to work on early Perls
Karl Williamson [Tue, 10 Mar 2015 20:53:21 +0000 (14:53 -0600)]
dist/Storable/t/utf8.t: Fix to work on early Perls

In commit 571d5cf7467f1af9ff1e6d751f49ac47e4f88380, I forgot that this
is dual-lifed and may be used on early Perls.  This commit allows that,
but it will fail if such a Perl were to be used on an EBCDIC platform.

8 years agodist/Safe/t/safeutf8.t: Fix to work on early Perls
Karl Williamson [Tue, 10 Mar 2015 20:53:05 +0000 (14:53 -0600)]
dist/Safe/t/safeutf8.t: Fix to work on early Perls

In commit fedc1b0e2d9cec34b7e3b1fa65dd0f7eb4f539fd, I forgot that this
is dual-lifed and may be used on early Perls.  This commit allows that,
but it will fail if such a Perl were to be used on an EBCDIC platform.

8 years agot/TEST: Avoid SIGPIPEs on os390
Karl Williamson [Tue, 26 Mar 2013 21:44:59 +0000 (15:44 -0600)]
t/TEST: Avoid SIGPIPEs on os390

This works around a problem with z/OS where if there are unread lines
from a file descriptor using this, a SIGPIPE error is raised.

8 years agoPOSIX/t/sigaction.t: Skip failing EBCDIC test
Karl Williamson [Fri, 27 Feb 2015 01:10:08 +0000 (18:10 -0700)]
POSIX/t/sigaction.t: Skip failing EBCDIC test

We don't know why this is faiing, but it also fails on another IBM
product, AIX 4.2.  Skip for now.  The code that is failing is this:
    sub hiphup {
        is($_[1]->{signo}, SIGHUP, "SA_SIGINFO got right signal");
    }
    my $act = POSIX::SigAction->new('hiphup', 0, SA_SIGINFO);
    sigaction(SIGHUP, $act);
    kill 'HUP', $$;
and it leads to this:
CEE3206S The system detected a specification exception (System Completion Code=0C6).
         From entry point Perl_apply at compile unit offset +00001460 at entry offset +00001460 at address 1F9B4A50.
ext/POSIX/t/sigaction ......................................... FAILED--expected 33 tests, saw 30

A stack trace with some analysis is in email <5490A778.30308@lerctr.org>

8 years agot/lib/open.t: Generalize for EBCDIC platforms
Karl Williamson [Fri, 17 Oct 2014 01:37:29 +0000 (19:37 -0600)]
t/lib/open.t: Generalize for EBCDIC platforms

This involved changing a \xff to \xfe because it is expecting it to be a
character whose representation is different when encoded in UTF-8, and
on some EBCDIC platforms, \xff is UTF-8 invariant.  I suppose there
could be a code page where \xfe is invariant, so this .t would have to
be made more general if that ever comes to be.

8 years agodist/IO/t/io_utf8argv.t: Generalize for non-ASCII platforms.
Karl Williamson [Wed, 27 Mar 2013 17:11:22 +0000 (11:11 -0600)]
dist/IO/t/io_utf8argv.t: Generalize for non-ASCII platforms.

8 years agomake perl -Dt display padnames with sort blocks
David Mitchell [Fri, 13 Mar 2015 12:39:42 +0000 (12:39 +0000)]
make perl -Dt display padnames with sort blocks

When a sort block (as opposed to sort sub) is executed, a new stackinfo is
pushed with a single CXt_NULL on top. Since S_deb_curcv() only examines
the *current* CX stack looking for the current running CV, it fails to
find it in this case and returns null.

This means that on threaded builds you get things like:

    $ perl -Dt -e'my $x; @a=sort { $x } 1,2'
    ...
    (-e:1) padsv([1])

where it can't find a pad to look up the name of the lexical at targ 1.

This commit makes S_deb_curcv() continue to the previous CX stack when it
finds it's on a PERLSI_SORT stackinfo. The output from the above is now:

    (-e:1) padsv($x)

8 years agoPerl_multideref_stringify: don't SEGV on null cv
David Mitchell [Fri, 13 Mar 2015 11:18:38 +0000 (11:18 +0000)]
Perl_multideref_stringify: don't SEGV on null cv

This function is called by e.g. "perl -Dt" to display the multideref op:

    $ perl -Dt -e'$a->{foo}[1]'
    ...
    (-e:1) multideref($a->{"foo"}[1])

On threaded builds, it needs to know the correct pad (and so the correct
cv too) so that it can access GVs and const SVs that have been moved to
the pad.

However with a sort code block (rather than a sort sub), S_deb_curcv()
returns null, so multideref_stringify() is called with a null CV. This
then SEGVs.

Although ideally S_deb_curcv() should be fixed, a function like
multideref_stringify(), which can be used for debugging, should be robust
in unexpected circumstances. So this commit makes it safe (although not
particularly useful) with a null CV:

    $ perl -Dt -e'@a = sort { $a->[$i] <=> $b->[$i] } [0], [1]'
    ...
    (-e:1) sort
    (-e:1) multideref(<NULLGV>->[<NULLGV>])
    (-e:1) multideref(<NULLGV>->[<NULLGV>])

8 years agoUpgrade CPAN from 2.09-TRIAL to 2.10.
Steve Hay [Fri, 13 Mar 2015 08:25:54 +0000 (08:25 +0000)]
Upgrade CPAN from 2.09-TRIAL to 2.10.

8 years agoOptimize out unicode_to_native(), native_to_unicode()
Karl Williamson [Tue, 10 Mar 2015 19:16:23 +0000 (13:16 -0600)]
Optimize out unicode_to_native(), native_to_unicode()

These just return their argument on ASCII platforms, so can get rid of
the function call overhead there.

Thanks to Zefram and Matthew Horsfall for their help in this.

8 years agoFix t/loc_tools.pl
Karl Williamson [Tue, 10 Mar 2015 20:52:08 +0000 (14:52 -0600)]
Fix t/loc_tools.pl

Commit 128e4113466e835078eb016709e5d23b86be3120 introduced a bug which
causes a failure only on netbsd.  It failed to make a copy in a function
of the array whose reference is passed into it, and then modified the
elements, thus changing the original.  I think what this does on other
platforms is to cause locales to be skipped from being tested (which is
wrong but doesn't show up as a test failure), but on netbsd, it appears
to expose a bug in their setlocale implementation, in which when
setlocale is called with an invalid category, it succeeds instead of
fails.

Another bug in that commit was fixed by
2cc6a9db5a91276f3ff662b3e5befa6799fde3ed.  But that fix introduced yet
another bug, by extending category numbers to be negative (when a given
category doesn't actually exist on a platform) but failing to allow for
a minus sign in the regex pattern that should match any such number.
This problem showed up on vms and os390.

This commit fixes both problems.

8 years agoperl.h: Only #define item once
Karl Williamson [Fri, 6 Mar 2015 20:27:41 +0000 (13:27 -0700)]
perl.h: Only #define item once

This definition was duplicated in both branches of an #if #else #endif
It's better to do it once, outside the #if.

8 years agoPOSIX: emulation for logb()
Jarkko Hietaniemi [Thu, 12 Mar 2015 11:24:59 +0000 (07:24 -0400)]
POSIX: emulation for logb()