This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 years agoAssorted File::Glob test fix-ups following 528bd3ce85.
Craig A. Berry [Fri, 16 Sep 2011 17:08:19 +0000 (12:08 -0500)]
Assorted File::Glob test fix-ups following 528bd3ce85.

- Avoid list assignment to %ENV, which fails at compile time on VMS.
- Use consistent indentation for readability.
- Mark bsd_glob('~') tests TODO on VMS. The HOME path is successfully
  retrieved, but it normally contains square brackets, which confuse
  glob, because it thinks the directory portion of the path contained
  within brackets is a pattern.  The path probably needs to be
  converted to Unix syntax first.

10 years agoDisallow weakening of read-only references
Father Chrysostomos [Fri, 16 Sep 2011 16:25:10 +0000 (09:25 -0700)]
Disallow weakening of read-only references

$ perl -MScalar::Util=weaken -le 'DESTROY{return if$_++;weaken$_[0]}$x=bless[]'
DESTROY created new reference to dead object 'main' during global destruction.

It says that because the reference count has gone down to -1 (or the
max unsigned value, whichever it is), and the error occurs when
SvREFCNT is true.  So there is no new reference to the dead object;
it’s just the refcount that’s off.

This case is worse:

$ perl -MScalar::Util=weaken -le 'DESTROY{weaken$_[0];$x=$_[0]}bless[];'
Segmentation fault

$_[0]’s reference count is normally lowered manually by sv_clear, to
avoid a recursive call to sv_clear (as lowering the reference count
normally triggers that).  If the variable has been weakened, then
$_[0] no longer holds a reference count.  sv_clear proceeds to destroy
at, as its reference count is 1 (held by $x), causing $x to point to a
freed scalar.  Not good.

Since $_[0] is read-only anyway, it should not be weakenable.

10 years agoperldelta update
Father Chrysostomos [Fri, 16 Sep 2011 16:21:05 +0000 (09:21 -0700)]
perldelta update

10 years agoRevert "Put Jesse's "How a Bill Becomes a Law" into perlhack (with editing)"
Dave Rolsky [Fri, 16 Sep 2011 14:07:52 +0000 (09:07 -0500)]
Revert "Put Jesse's "How a Bill Becomes a Law" into perlhack (with editing)"

This reverts commit 6a945912f2861921b440402072b7053a1dc414a5.

10 years agoPartial perldelta update
Father Chrysostomos [Fri, 16 Sep 2011 13:17:28 +0000 (06:17 -0700)]
Partial perldelta update

10 years agoi_stdbool for configure.com.
Craig A. Berry [Fri, 16 Sep 2011 12:38:40 +0000 (07:38 -0500)]
i_stdbool for configure.com.

The comments in the header itself say that it needs DEC C 6.4 or
later.

10 years agoRegenerate. Sorry for the massive re-order
H.Merijn Brand [Fri, 16 Sep 2011 11:21:07 +0000 (13:21 +0200)]
Regenerate. Sorry for the massive re-order

10 years agoProbe for <stdbool.h>, and if found use it in handy.h
Nicholas Clark [Wed, 14 Sep 2011 12:03:31 +0000 (14:03 +0200)]
Probe for <stdbool.h>, and if found use it in handy.h

This means that the core uses the compiler's bool type if one exists.
This avoids potential problems of clashes between perl's own implementation
of bool and the compiler's bool type, which otherwise occur when one
attempts to include headers which in turn include <stdbool.h>.

Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
10 years agoDear perlvar: ${\ fPEN} was introduced in 5.8.0.
Father Chrysostomos [Fri, 16 Sep 2011 05:45:37 +0000 (22:45 -0700)]
Dear perlvar: ${\ fPEN} was introduced in 5.8.0.

10 years ago[perl #92728] open.pm without :std should leave std alone
Father Chrysostomos [Fri, 16 Sep 2011 03:22:28 +0000 (20:22 -0700)]
[perl #92728] open.pm without :std should leave std alone

‘use open’ without :std was turning off layers on STDIN and STDOUT
(but not STDERR), due to a few missing if() conditions and due to an
omission of STDERR (which probably also caused STDERR’s handles to
accumulate through multiple calls to ‘use open ':std'...’).

This fixes that.  (As if you were expecting otherwise.)

10 years agoMake open.t use test.pl
Father Chrysostomos [Fri, 16 Sep 2011 02:58:43 +0000 (19:58 -0700)]
Make open.t use test.pl

so future commits can use runperl.

10 years agoAdd a mention of #p5p to perlhack
Dave Rolsky [Fri, 16 Sep 2011 04:26:54 +0000 (23:26 -0500)]
Add a mention of #p5p to perlhack

10 years agoPut Jesse's "How a Bill Becomes a Law" into perlhack (with editing)
Dave Rolsky [Fri, 16 Sep 2011 04:26:45 +0000 (23:26 -0500)]
Put Jesse's "How a Bill Becomes a Law" into perlhack (with editing)

10 years agoWording tweak to clarify that perlbug submits the patch for you via email
Dave Rolsky [Fri, 16 Sep 2011 04:06:43 +0000 (23:06 -0500)]
Wording tweak to clarify that perlbug submits the patch for you via email

10 years agoRun podtidy on perlhack.pod
Dave Rolsky [Fri, 16 Sep 2011 04:06:23 +0000 (23:06 -0500)]
Run podtidy on perlhack.pod

10 years agoMake tie_fetch_count.t skip -[guk] globref tests
Father Chrysostomos [Fri, 16 Sep 2011 01:08:17 +0000 (18:08 -0700)]
Make tie_fetch_count.t skip -[guk] globref tests

When trying to fix this before (4a021280) I assumed that these func-
tions would die on primitive platforms, without even looking at the
code to make sure.

They don’t die, but return false.

Since Config does not list them, we just have to skip the -k \$tied
tests on all platforms.

Since they share the same code as a whole list of other filetest ops,
I think this code is still tested well enough.

10 years ago[perl #99142] Make GV_ADDMG and magic vars account for s(t)ubs
Father Chrysostomos [Fri, 16 Sep 2011 00:56:30 +0000 (17:56 -0700)]
[perl #99142] Make GV_ADDMG and magic vars account for s(t)ubs

When I eliminated is_gv_magical_sv (commit 23496c6ea), I did not take
into account that existing symbol table elements might not be GVs.
The special handling that GV_ADDMG does (to avoid creating a GV at all
unless a magical variable is created) simply does not apply if there
is a stash element there already, so this commit disables it.

The special handling involves creating a GV without assigning it to
the symbol table until the end of the function, where it gets freed if
it turns out not to contain a magical variable.  If the GV it is deal-
ing with is actually a non-GV that was residing in a stash element,
then we end up freeing something still in use.

When I made defined(&{"name"}) vivify CORE:: subs (commit 9da346da9),
this bug was extended to defined(&{"name"}), causing the
HTTP::MobileAttribute failure reported in the RT ticket (which was
actually triggered directly by code in Class::Inspector, but which
required HTTP::MobileAttribute’s test suite to make it apparent).

10 years agodocument convention for keys in %^H
Zefram [Thu, 15 Sep 2011 21:35:20 +0000 (22:35 +0100)]
document convention for keys in %^H

10 years agoFix some bugs in the example code for perlootut
Dave Rolsky [Thu, 15 Sep 2011 14:03:09 +0000 (09:03 -0500)]
Fix some bugs in the example code for perlootut

10 years agoremove outdated information from perlport
Moritz Lenz [Thu, 15 Sep 2011 12:26:52 +0000 (14:26 +0200)]
remove outdated information from perlport

10 years agoDon't #include headers already included by perl.h
Nicholas Clark [Wed, 14 Sep 2011 13:21:28 +0000 (15:21 +0200)]
Don't #include headers already included by perl.h

097ee67dff1c60f2 didn't need to include <locale.h> in locale.c (then
util.c) because it had been included by perl.h since 5.002 beta 1
3f270f98f9305540 missed removing the include of <unistd.h> from perl.c
or perlio.c
de8ca8af19546d49 changed perl.h to also include <sys/wait.h>, but didn't
notice that it code therefore be removed from perl.c, pp_sys.c and util.c

10 years agoUse test.pl miniperl check rather than by-hand in t/io/shm.t
George Greer [Thu, 15 Sep 2011 03:46:44 +0000 (23:46 -0400)]
Use test.pl miniperl check rather than by-hand in t/io/shm.t

Doing the miniperl check by hand didn't exit() so the test script would die
as soon as it got down to the "use IPC::SysV" line.

10 years agoTests in "t/io" aren't supposed to use Test::More yet, so use test.pl instead.
George Greer [Thu, 15 Sep 2011 03:45:54 +0000 (23:45 -0400)]
Tests in "t/io" aren't supposed to use Test::More yet, so use test.pl instead.

10 years agoshm.t: Skip under miniperl
Father Chrysostomos [Thu, 15 Sep 2011 01:07:02 +0000 (18:07 -0700)]
shm.t: Skip under miniperl

10 years agoshm.t: Don’t call shmctl in END when undefined
Father Chrysostomos [Wed, 14 Sep 2011 23:12:59 +0000 (16:12 -0700)]
shm.t: Don’t call shmctl in END when undefined

The skip was not inside a BEGIN block, so the END block ended up
getting compiled and running.

10 years agoBe more precise in the wording of how // works.
Abigail [Wed, 14 Sep 2011 23:38:41 +0000 (01:38 +0200)]
Be more precise in the wording of how // works.

See the discussion starting with mail:9879.1315954489@chthon
This rephrasing should avoid people getting the impression // is a
source filter, translating 'A // B' into 'defined(A) ? A : B', and
reparsing the result.

10 years ago[perl #92436] Make Filter::Simple match variables better
Father Chrysostomos [Wed, 14 Sep 2011 20:43:45 +0000 (13:43 -0700)]
[perl #92436] Make Filter::Simple match variables better

(This is the second bug reported in ticket #92436.)

Filter::Simple was using Text::Balanced’s extract_variable, which

       ...extracts any valid Perl variable or variable-
       involved expression, including scalars, arrays, hashes, array
       accesses, hash look-ups, method calls through objects, subrou-
       tine calls through subroutine references, etc.

So it extracts things like $x->foo("blah lbah blah").  That means
that, when the user of Filter::Simple asks for everything except
strings, "blah lbah blah" is passed through anyway, because
Filter::Simple things it’s part of a variable name.  That obviously
doesn’t work.

This commit makes Filter::Simple use a regular expression for varia-
bles, as it does for other things.  It’s certainly not foolproof, but
Filter::Simple in general is not foolproof, and this regular expres-
sion is actually less foolproof than most parts of Filter::Simple.  So
it’s a step in the right direction (unless you consider deletion to be
the right direction).

10 years agoDear CoreList: Please note that 5.12.3 included VMS::Filespec.
Father Chrysostomos [Wed, 14 Sep 2011 20:08:44 +0000 (13:08 -0700)]
Dear CoreList: Please note that 5.12.3 included VMS::Filespec.

10 years agoFix #98480 math when reading shared memory
Leon Timmermans [Tue, 13 Sep 2011 18:13:22 +0000 (20:13 +0200)]
Fix #98480 math when reading shared memory

shmread didn't unset SvIOK properly, causing a read into a SVIV to have
an incorrect numeric value. This patch fixes that and adds tests.

10 years agoAdded SysV shared memory tests
Leon Timmermans [Tue, 13 Sep 2011 16:34:28 +0000 (18:34 +0200)]
Added SysV shared memory tests

Tests are based on IPC-SysV's tests, though I had to remove a lot for it
not to rely on IPC::SharedMem.

10 years agoDear CoreList: FYI, Errno was included in 5.6.0 and .1.
Father Chrysostomos [Wed, 14 Sep 2011 16:32:53 +0000 (09:32 -0700)]
Dear CoreList: FYI, Errno was included in 5.6.0 and .1.

10 years agoDear CoreList: 5.8.2 *did* include DB_File.
Father Chrysostomos [Wed, 14 Sep 2011 13:20:37 +0000 (06:20 -0700)]
Dear CoreList: 5.8.2 *did* include DB_File.

10 years agoMissing word in release managers’ guide
Father Chrysostomos [Tue, 13 Sep 2011 21:44:11 +0000 (14:44 -0700)]
Missing word in release managers’ guide

10 years agoMention that a method can be thought of as a verb for an object
Dave Rolsky [Wed, 14 Sep 2011 15:39:21 +0000 (10:39 -0500)]
Mention that a method can be thought of as a verb for an object

10 years agoMention mutator as synonym for setter
Dave Rolsky [Wed, 14 Sep 2011 14:24:37 +0000 (09:24 -0500)]
Mention mutator as synonym for setter

10 years agoMerge Storable improvements (XS tidying, test failures on older perls).
Nicholas Clark [Wed, 14 Sep 2011 10:55:11 +0000 (12:55 +0200)]
Merge Storable improvements (XS tidying, test failures on older perls).

10 years agoNote Storable changes in perldelta.
Nicholas Clark [Wed, 14 Sep 2011 10:53:18 +0000 (12:53 +0200)]
Note Storable changes in perldelta.

10 years agoSimplify Storable.xs by providing a fallback definition of HvTOTALKEYS().
Nicholas Clark [Tue, 13 Sep 2011 15:37:10 +0000 (17:37 +0200)]
Simplify Storable.xs by providing a fallback definition of HvTOTALKEYS().

Longer term this should be added to ppport.h

10 years agoChange Storable's code.t to serialise a subroutine under our control.
Nicholas Clark [Sat, 10 Sep 2011 19:18:00 +0000 (21:18 +0200)]
Change Storable's code.t to serialise a subroutine under our control.

The test originally testing serialising and deserialising \&Test::ok. When
the test was converted from Test.pm to Test::More in 2009, it was changed to
use \&Test::More::ok. However, this turns out to be "works on my machine".
Test::More::ok from Test::Simple 0.61 onwards (2005, b1ddf16980125497) will
deserialise correctly. The previous implementation of Test::More::ok uses a
lexical from an outer scope. Hence the textual representation of the
subroutine (in isolation) fails to deserialise, because it's not valid under
strict, because there is no visible declaration of the lexical.

Hence switch to testing a large subroutine under our control, _store(), to
avoid unpleasant surprises from dependencies we were not even aware of.

The comment "large scalar" dates from the original test using \&Test::ok.
It's not clear which large scalar it refers to.

10 years agoRemove from Storable.xs all compatibility code that duplicates ppport.h
Nicholas Clark [Sat, 10 Sep 2011 16:15:03 +0000 (18:15 +0200)]
Remove from Storable.xs all compatibility code that duplicates ppport.h

The rest should probably be migrated to Devel::PPPort.

10 years agoRestore 5.004 and 5.005 support in Storable.
Nicholas Clark [Sat, 10 Sep 2011 15:14:31 +0000 (17:14 +0200)]
Restore 5.004 and 5.005 support in Storable.

Add XSLoader as a prerequisite.
Use parentheses for the call to XSLoader::load().
Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.

Avoid the T_BOOL typemap, as xsubpp will always mortalise the SV generated
by processing RETVAL, T_BOOL generates the SV using boolSV() which returns
PL_sv_yes or PL_sv_no, and on 5.004 Perl_sv_2mortal() will croak if passed
a readonly scalar. This is actually a small optimisation on later perls, as
the call to Perl_sv_2mortal() isn't actually needed.

Avoid repeating the PPCODE by merging last_op_in_netorder() with
is_storing() and is_retrieving(). (Which I didn't spot was easy to do
when commit 7cb18e1b020cd2e5 merged is_storing() and is_retrieving().)

Together these reduce the size of the shared object by about 200 bytes on
this platform. Small, but in the right direction.

10 years agoRemove Symbian compatibility macros from Storable, now supplied by ppport.h
Nicholas Clark [Sat, 10 Sep 2011 11:43:57 +0000 (13:43 +0200)]
Remove Symbian compatibility macros from Storable, now supplied by ppport.h

ppport.h provides default definitions for PERL_UNUSED_DECL, dNOOP and dVAR,
so no need to duplicate this in Storable.xs

10 years agoSimplify S_set_caret_X() by returning early if we set caret_x.
Nicholas Clark [Tue, 13 Sep 2011 19:58:56 +0000 (21:58 +0200)]
Simplify S_set_caret_X() by returning early if we set caret_x.

This avoids duplicating the fallback code to set caret_x to PL_origargv[0].

10 years agoInline S_procself_val() into S_set_caret_x().
Nicholas Clark [Tue, 13 Sep 2011 19:31:34 +0000 (21:31 +0200)]
Inline S_procself_val() into S_set_caret_x().

Possibly this should have been done as part of commit 3aa90d208c3bbfc1,
which broke S_set_caret_X() out from S_init_postdump_symbols().
[S_procself_val() was not inlined into S_init_postdump_symbols() because
Nick Ing-Simmons thought it unwise to hold on to MAXPATHLEN bytes of stack
longer than necessary.]

10 years agoIn S_set_caret_X(), use GvSV() consistently in all conditional code.
Nicholas Clark [Tue, 13 Sep 2011 19:07:06 +0000 (21:07 +0200)]
In S_set_caret_X(), use GvSV() consistently in all conditional code.

Commit c69033f2a6291605 was inconsistent, in that it changed two instances
of GvSV() to GvSVn(), but not the third. The expansion of GvSV() is simpler,
and is appropriate here. Hoist the call to GvSV() out of the conditional
code.

10 years agoBump $Module::CoreList::VERSION after 77cc041da6484066.
Nicholas Clark [Tue, 13 Sep 2011 15:27:00 +0000 (17:27 +0200)]
Bump $Module::CoreList::VERSION after 77cc041da6484066.

10 years agoCorrected the version of Module::CoreList shipped with v5.10.0
Chris 'BinGOs' Williams [Tue, 13 Sep 2011 13:08:09 +0000 (14:08 +0100)]
Corrected the version of Module::CoreList shipped with v5.10.0

10 years agoMerge POSIX improvements (refactoring, tests, bugfix for Solaris)
Nicholas Clark [Tue, 13 Sep 2011 10:10:18 +0000 (12:10 +0200)]
Merge POSIX improvements (refactoring, tests, bugfix for Solaris)

10 years agoChange POSIX::Termios::setattr() to default to TCASNOW, not 0.
Nicholas Clark [Mon, 12 Sep 2011 12:11:05 +0000 (14:11 +0200)]
Change POSIX::Termios::setattr() to default to TCASNOW, not 0.

0 isn't valid on all operating systems. TCASNOW has the value 0 on most
operating systems, but on Solaris (at least) TCASNOW, TCSADRAIN and
TCSAFLUSH have the same values as the equivalent ioctls, TCSETS, TCSETSW and
TCSETSF. Solaris faults 0, setting errno to EINVAL. This isn't useful as a
default behaviour.

10 years agoRemove unneeded fallback definitions of dNOOP, dVAR etc from POSIX.xs
Nicholas Clark [Sat, 10 Sep 2011 11:28:19 +0000 (13:28 +0200)]
Remove unneeded fallback definitions of dNOOP, dVAR etc from POSIX.xs

As POSIX.xs is not dual life, we can always rely on these macros being
defined for us in perl.h. (And these days, dual life XS code should let
Devel::PPPort take care of this sort of thing.)

10 years agoUpdate perldelta to note that POSIX.so is now 12% smaller.
Nicholas Clark [Sat, 10 Sep 2011 10:20:08 +0000 (12:20 +0200)]
Update perldelta to note that POSIX.so is now 12% smaller.

Also record that there are more tests.

10 years agoMerge the implementations of POSIX::{asctime,mktime} using ALIAS.
Nicholas Clark [Fri, 9 Sep 2011 21:55:25 +0000 (23:55 +0200)]
Merge the implementations of POSIX::{asctime,mktime} using ALIAS.

This shares identical code marshaling 6 to 9 input arguments into a
struct tm. However, as the return types differ we have to explicitly code
pushing the return value onto perl's stack.

10 years agoMerge the implementations of POSIX::{access,mkfifo} using ALIAS.
Nicholas Clark [Fri, 9 Sep 2011 21:25:08 +0000 (23:25 +0200)]
Merge the implementations of POSIX::{access,mkfifo} using ALIAS.

10 years agoMerge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.
Nicholas Clark [Fri, 9 Sep 2011 21:14:22 +0000 (23:14 +0200)]
Merge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.

On this platform, this reduces the shared object size by about .5K.

10 years agoAdd tests for POSIX::{access,close,dup,dup2}.
Nicholas Clark [Fri, 9 Sep 2011 20:36:33 +0000 (22:36 +0200)]
Add tests for POSIX::{access,close,dup,dup2}.

10 years agoIn ext/POSIX/t/sysconf.t, make the tests more strict.
Nicholas Clark [Fri, 9 Sep 2011 16:59:00 +0000 (18:59 +0200)]
In ext/POSIX/t/sysconf.t, make the tests more strict.

$! should always be 0 after each call, so test this whether the result is
defined or undefined. Match a defined result against a regex to ensure that
it is an integer, and give better diagnostics if it is not.

10 years agoIn ext/POSIX/t/sysconf.t, refactor the API of _check_and_report().
Nicholas Clark [Fri, 9 Sep 2011 16:36:15 +0000 (18:36 +0200)]
In ext/POSIX/t/sysconf.t, refactor the API of _check_and_report().

The new API removes a lot of code repetition in the callers.

10 years agoIn various POSIX tests, make better use of Test::More.
Nicholas Clark [Fri, 9 Sep 2011 16:10:19 +0000 (18:10 +0200)]
In various POSIX tests, make better use of Test::More.

Avoid using ok() when alternatives are available, as ok() can't give useful
diagnostics on failure.

10 years agoMerge the implementations of 11 is*() functions in POSIX using XSANY.
Nicholas Clark [Fri, 9 Sep 2011 12:57:19 +0000 (14:57 +0200)]
Merge the implementations of 11 is*() functions in POSIX using XSANY.

is{alnum,alpha,cntrl,digit,graph,lower,print,punct,space,upper,xdigit}
have identical structures, so replace them with one body to marshal
arguments between Perl and C, calling the C library is*() function via
a function pointer stored in the CV's XSANY.

10 years agoMerge the implementations of 10 maths functions in POSIX using ALIAS.
Nicholas Clark [Fri, 9 Sep 2011 10:39:13 +0000 (12:39 +0200)]
Merge the implementations of 10 maths functions in POSIX using ALIAS.

10 functions take a single NV argument and return an NV result. Merging them
reduces the shared object size by over 2K on this platform. (Argument
marshalling code in XS is not free.)

10 years agoFurther tests for POSIX trigonometric and hyperbolic functions.
Nicholas Clark [Thu, 8 Sep 2011 14:08:16 +0000 (16:08 +0200)]
Further tests for POSIX trigonometric and hyperbolic functions.

10 years agoChange POSIX::localeconv() to a table-driven implementation.
Nicholas Clark [Thu, 8 Sep 2011 13:28:04 +0000 (15:28 +0200)]
Change POSIX::localeconv() to a table-driven implementation.

This removes a lot of copy-paste code.

[with a tweak by Ilmari that removed residual duplication]

10 years agoAdd tests for POSIX::localeconv().
Nicholas Clark [Thu, 8 Sep 2011 12:37:09 +0000 (14:37 +0200)]
Add tests for POSIX::localeconv().

10 years agoMerge the implementations of 2 sets of POSIX functions.
Nicholas Clark [Thu, 8 Sep 2011 11:05:05 +0000 (13:05 +0200)]
Merge the implementations of 2 sets of POSIX functions.

Using ALIAS to merge POSIX::sig{pending,suspend} and
POSIX::tc{flow,flush,sendbreak} reduces the size of POSIX.so by about 2K
on this platform.

10 years agoMerge the implementations of 4 sets of POSIX::Termios methods.
Nicholas Clark [Thu, 8 Sep 2011 10:41:10 +0000 (12:41 +0200)]
Merge the implementations of 4 sets of POSIX::Termios methods.

Using ALIAS to merge cfget[io]speed(), get[cloi]flag(), cfset[io]speed()
and set[cloi]flag() reduces the size of POSIX.so by almost 2K on this
platform.

10 years agoMerge the implementations of 2 pairs of POSIX::SigSet methods.
Nicholas Clark [Thu, 8 Sep 2011 10:05:06 +0000 (12:05 +0200)]
Merge the implementations of 2 pairs of POSIX::SigSet methods.

Using ALIAS to merge addset() with delset() and emptyset() with fillset()
reduces the shared object size, by removing duplicate marshaling code for
arguments and return values. On this platform the saving is over .5K

10 years agoAdd tests for POSIX::sigpending().
Nicholas Clark [Thu, 8 Sep 2011 08:11:55 +0000 (10:11 +0200)]
Add tests for POSIX::sigpending().

10 years agoStore sigset_t used by POSIX::SigSet directly in the object SV.
Nicholas Clark [Wed, 7 Sep 2011 16:52:36 +0000 (18:52 +0200)]
Store sigset_t used by POSIX::SigSet directly in the object SV.

Previously POSIX::SigSet was using the PTROBJ typemap to store a pointer to
a dynamically-allocated sigset_t as an IV (blessed into the class)
This requires an explicit DESTROY to free the dynamic allocation, but fails
badly if any POSIX::SigSet objects exist at ithread clone time, as the
dynamic allocation is not duplicated in the new thread. (DESTROY is called
in both threads, free-from-wrong pool or other jollity occurs.)

Removing dynamic allocation removes the need for a DESTROY method.

This change is analogous to the previous change in POSIX::Termios, and is
made for the same reason.

10 years agoIn POSIX.xs, extract allocate_struct() from POSIX::Termios::new().
Nicholas Clark [Wed, 7 Sep 2011 14:57:03 +0000 (16:57 +0200)]
In POSIX.xs, extract allocate_struct() from POSIX::Termios::new().

The same code will be needed for POSIX::SigSet::new(), so share it as a small
static function.

10 years agoAdd tests for POSIX::SigSet.
Nicholas Clark [Wed, 7 Sep 2011 14:22:33 +0000 (16:22 +0200)]
Add tests for POSIX::SigSet.

10 years agoStore struct termios used by POSIX::Termios directly in the object SV.
Nicholas Clark [Wed, 7 Sep 2011 11:15:04 +0000 (13:15 +0200)]
Store struct termios used by POSIX::Termios directly in the object SV.

Previously POSIX::Termios was using the PTROBJ typemap to store a pointer to
a dynamically-allocated struct termios as an IV (blessed into the class).
This requires an explicit DESTROY to free the dynamic allocation, but fails
badly if any POSIX::Termios objects exist at ithread clone time, as the
dynamic allocation is not duplicated in the new thread. (DESTROY is called
in both threads, free-from-wrong pool or other jollity occurs.)

Removing dynamic allocation removes the need for a DESTROY method.

This introduces a new OPAQUEPTROBJ typemap, but currently doesn't use the
OUTPUT section, as that copies an existing structure, whereas
POSIX::Termios->new() only needs to zero-allocate the right space. Assuming
that this typemap should be of general applicability, it should be moved to
the main typemap file.

10 years agoAdd tests for POSIX::tc{drain,flow,flush,sendbreak}()
Nicholas Clark [Tue, 6 Sep 2011 20:22:36 +0000 (22:22 +0200)]
Add tests for POSIX::tc{drain,flow,flush,sendbreak}()

We don't want to mess with the user's terminal (as we might mess it up), so
attempt to call each function on a disk file, and verify that it fails with
ENOTTY.

10 years agoAdd tests for POSIX::Termios->setattr().
Nicholas Clark [Tue, 6 Sep 2011 20:11:49 +0000 (22:11 +0200)]
Add tests for POSIX::Termios->setattr().

We don't want to mess with the user's terminal (as we might mess it up), so
attempt to call tcsetattr() on a disk file, and verify that it fails with
ENOTTY.

10 years agoAdd tests for POSIX::Termios->setcc().
Nicholas Clark [Tue, 6 Sep 2011 19:58:09 +0000 (21:58 +0200)]
Add tests for POSIX::Termios->setcc().

10 years agoAdd tests for POSIX::Termios->get[iocf]flags().
Nicholas Clark [Tue, 6 Sep 2011 17:37:35 +0000 (19:37 +0200)]
Add tests for POSIX::Termios->get[iocf]flags().

10 years agoAdd tests for POSIX::Termios->get[io]speed().
Nicholas Clark [Tue, 6 Sep 2011 16:38:21 +0000 (18:38 +0200)]
Add tests for POSIX::Termios->get[io]speed().

10 years agoAdd tests for passing POSIX::Termios->getcc() out of range subscripts.
Nicholas Clark [Tue, 6 Sep 2011 12:23:53 +0000 (14:23 +0200)]
Add tests for passing POSIX::Termios->getcc() out of range subscripts.

10 years agoIn termios.t, avoid reading uninitialised memory in the tests.
Nicholas Clark [Tue, 6 Sep 2011 12:12:22 +0000 (14:12 +0200)]
In termios.t, avoid reading uninitialised memory in the tests.

If no terminal devices are found, or getattr() fails on all of them, then
the struct termios wrapped by the POSIX:Termios object will consist of
initialised memory. In this case, it's not possible to use getcc() or the
other get*() methods on it.

Try harder to find a terminal device - as well as STDIN, STDOUT and STDERR
also try to open the controlling terminal directly.

10 years agoRefactor ext/POSIX/t/termios.t
Nicholas Clark [Tue, 6 Sep 2011 11:36:07 +0000 (13:36 +0200)]
Refactor ext/POSIX/t/termios.t

* Only import termios.h functions and constants from POSIX
* Loop over STDIN, STDOUT, STDERR instead of duplicating code.
* Avoid a needless defined? test, as isa_ok() handles undef.
* Switch to done_testing(), which also allows @getters to be inlined and
  eliminated.
* The various get*() methods return integer values, so check this.
* Enable warnings.

10 years agoRemove if(isGV_with_GP(PL_defoutgv)) checks from mg.c
Father Chrysostomos [Tue, 13 Sep 2011 06:31:18 +0000 (23:31 -0700)]
Remove if(isGV_with_GP(PL_defoutgv)) checks from mg.c

Commit 099be4f1d added code to cope with this:

    my $x = *STDERR; select($x); $x = 1;

which would cause PL_defoutgv to hold something other than a GV,
resulting in various crashes.

Commit 2acc3314 changed the way rv2gv works on fake globs, and inad-
vertently fixed this problem, too, so PL_defoutgv can no longer end up
holding something other than a GV.

So the code that checks if(isGV_with_GP(PL_defoutgv)) can go.

10 years agoFix misspellings in gv.t
Father Chrysostomos [Tue, 13 Sep 2011 06:01:52 +0000 (23:01 -0700)]
Fix misspellings in gv.t

10 years agoMake \&$tied call get-magic when it holds a glob
Father Chrysostomos [Tue, 13 Sep 2011 05:42:54 +0000 (22:42 -0700)]
Make \&$tied call get-magic when it holds a glob

This is a follow-up to ff55a0191f1, but this bug has probably existed
as long as ties.

\&$tied_scalar was ignoring get-magic on $tied if it happened to
hold a glob.

10 years agoAdd diag_listed_as for lstat error msg
Father Chrysostomos [Tue, 13 Sep 2011 05:28:55 +0000 (22:28 -0700)]
Add diag_listed_as for lstat error msg

to let porting/diag.t know how it’s listed in perldiag.

10 years agoMake (l)stat respect get-magic on globs and globrefs
Father Chrysostomos [Tue, 13 Sep 2011 03:41:07 +0000 (20:41 -0700)]
Make (l)stat respect get-magic on globs and globrefs

They were ignoring get-magic for those.

A side effect of this fix is that lstat filehandle warnings and errors
are now consistent:

lstat _ used to die if the previous stat was not an lstat, but
lstat *_ and lstat \*_ would happily return what was in the buffer.
Now they die.

lstat FH and \*FH used to warn, but not lstat *FH.  Now it does.

See bug #98864.

10 years agoUpdate CPAN-Meta-YAML to CPAN version 0.004
Chris 'BinGOs' Williams [Mon, 12 Sep 2011 18:44:07 +0000 (19:44 +0100)]
Update CPAN-Meta-YAML to CPAN version 0.004

  [DELTA]

  0.004     2011-09-06 09:42:52 America/New_York

    - Generated from ADAMK/YAML-Tiny-1.50.tar.gz

10 years agoUpdate Exporter to CPAN version 5.65
Chris 'BinGOs' Williams [Mon, 12 Sep 2011 18:19:35 +0000 (19:19 +0100)]
Update Exporter to CPAN version 5.65

  [DELTA]

  5.65 Tue Aug 30 2011 Todd Rinaldo
        - No changes. Tests clean. Bumping to production release.

  5.64_04 Wed Aug 24 2011 Todd Rinaldo
        - Re-vamp module to work in Git.
        - Update Makefile.PL with extra META bits.
        - Point bugs to perl's RT.
        - Add a README from Exporter.pm perldoc.
        - Depend on Carp 1.05 now we're assuming a fix from 1.05

10 years agoUpdate perlfaq to CPAN version 5.0150034
Chris 'BinGOs' Williams [Mon, 12 Sep 2011 17:57:18 +0000 (18:57 +0100)]
Update perlfaq to CPAN version 5.0150034

  [DELTA]

  5.0150034 Mon 12 Sep 2011 18:41:25 +0100
    * Copy edit Perl 6 a bit more (ranguard)
    * Add blog section (ranguard)
    * Update much of the copy about emails in perlfaq9 (apeiron)
    * Many small changes (bigpresh)
    * Add descriptions to doc list (bigpresh)
    * Start moving away from global file handles (shlomif)
    * Typos, clarity and other cleanups (shlomif)
    * Cleanup copy (ranguard)
    * Start to add "my" to variables (shlomif)
    * Remove verbose/history copy (ranguard)
    * Switch to L<> around URLs (ranguard)

10 years agoMake tie_fetch_count.t pass on ‘broken’ platforms
Father Chrysostomos [Mon, 12 Sep 2011 13:28:09 +0000 (06:28 -0700)]
Make tie_fetch_count.t pass on ‘broken’ platforms

by which I mean platforms on which some -X $file ops don’t work.

10 years agot/TEST: clean up cachegrind.out.$pid intermediate files
Jim Cromie [Mon, 12 Sep 2011 05:32:50 +0000 (23:32 -0600)]
t/TEST: clean up cachegrind.out.$pid intermediate files

running cachegrind leaves lots of intermediate files, delete them at
the end.  Killing make test leaves them around, but this may be useful
for some debugging purposes.

Rework _find_tests($dir) into _find_files($patt,$dir) and wrapper,
to support existing uses and new one.

10 years agoadd 3 test.valgrind outputs to .gitignore
Jim Cromie [Sun, 11 Sep 2011 01:16:18 +0000 (19:16 -0600)]
add 3 test.valgrind outputs to .gitignore

10 years agoUpdate CPAN tracking version of ExtUtils::ParseXS
Steffen Mueller [Mon, 12 Sep 2011 06:26:52 +0000 (08:26 +0200)]
Update CPAN tracking version of ExtUtils::ParseXS

10 years agoperldelta galore for ExtUtils::ParseXS changes
Steffen Mueller [Mon, 12 Sep 2011 06:25:31 +0000 (08:25 +0200)]
perldelta galore for ExtUtils::ParseXS changes

This also rephrases the "XSUBs are now static" section since the
exact behaviour has changed since 5.15.2.

10 years agoExtUtils::ParseXS changelog
Steffen Mueller [Mon, 12 Sep 2011 06:25:04 +0000 (08:25 +0200)]
ExtUtils::ParseXS changelog

10 years agoMake cpan officially upstream for Text::Balanced
Father Chrysostomos [Mon, 12 Sep 2011 03:00:18 +0000 (20:00 -0700)]
Make cpan officially upstream for Text::Balanced

10 years agoMake truncate respect get-magic on globs and globrefs
Father Chrysostomos [Sun, 11 Sep 2011 05:49:12 +0000 (22:49 -0700)]
Make truncate respect get-magic on globs and globrefs

It was ignoring get-magic for those.

10 years agoUpdate Devel-PPPort to CPAN version 3.20
Chris 'BinGOs' Williams [Sun, 11 Sep 2011 21:23:46 +0000 (22:23 +0100)]
Update Devel-PPPort to CPAN version 3.20

  [DELTA]

  3.20 - 2011-09-10

    * fix CPAN #56749: isASCII and isCNTRL macros are buggy
      (thanks to Karl Williamson for providing a patch and patiently
       waiting almost two years for me to integrate it)
    * fix CPAN #70427: RealPPPort.xs:1587: error: lvalue required as unary â€˜&’ operand

  3.19_03 - 2011-04-13

    * keep up with latest core changes

  3.19_02 - 2010-03-07

    * fix a warning emitted by the test suite with older perls
    * added support for the following API
        newSVpvs_share
        get_cvn_flags
        get_cvs
      (thanks to Goro Fuji for providing a patch to
      implement all of these, fixes CPAN #47174)

  3.19_01 - 2010-02-20

    * fix CPAN #50763: mistaken use of $[
      (thanks to Zefram for spotting this)
    * remove spurious PUSHMARK from Perl_ppaddr_t
      (thanks to Gerard Goossen for providing a patch)
    * improved support for newer compilers in buildperl.pl
      (thanks to Philippe Bruhat (BooK) for providing a patch)
    * added support for the following API
        memEQs
        memNEs
    * lots of small toolchain updates

10 years agoAdd links to Windows documentation of shell and CRT quote parsing rules
Steve Hay [Sun, 11 Sep 2011 22:01:57 +0000 (23:01 +0100)]
Add links to Windows documentation of shell and CRT quote parsing rules

10 years agoRemove Windows 95 support from win32/makefile.mk
Steve Hay [Sun, 11 Sep 2011 18:50:33 +0000 (19:50 +0100)]
Remove Windows 95 support from win32/makefile.mk

All supporting code for Windows 95 was already removed in 8cbe99e5b6.

10 years agoEliminate warnings from XSLoader on 5.005 and 5.004.
Nicholas Clark [Sat, 10 Sep 2011 15:10:55 +0000 (17:10 +0200)]
Eliminate warnings from XSLoader on 5.005 and 5.004.

Don't pass parameters that old ExtUtil::MakeMaker doesn't understand.
Ensure that $DynaLoader::dl_debug exists prior to calling into DynaLoader's
XS code.

10 years agoupdated podcheck data file to know about the changes from Leon's patch
Jesse Vincent [Sun, 11 Sep 2011 17:10:01 +0000 (13:10 -0400)]
updated podcheck data file to know about the changes from Leon's patch