| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here is some suspicious code in Perl_my_lstat_flags:
if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) {
Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
GvENAME((const GV *)SvRV(sv)));
return (PL_laststatval = -1);
}
The behaviour differs depending on whether warnings are enabled.
That -1 turns into undef in pp_ftlink. So we get an undef return
value with warnings on, but a file test on a file name otherwise.
In 5.6.2, -l $foo always treated $foo as a file name.
In 5.8+, if it is a reference (ignoring magic) and the reference
points to a typeglob (ignoring magic) and io warnings are on, it warns
and returns undef.
So the only time that undef return is reached is when a warning has
been emitted, so it’s code that will likely be corrected before it
goes into production. Hence I think it unlikely that anyone could be
relying on the behaviour of -l \*foo (under warnings).
So this commit restores the 5.6 behaviour for that case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Perl 5.10.0 introduced stacked filetest operators,
-x -r $foo
being equivalent to
-r $foo && -x _
That does not work with -l. It was these suspicious lines in
Perl_my_lstat_flags that drew my attention to it:
> else if (PL_laststype != OP_LSTAT
> && (PL_op->op_private & OPpFT_STACKED) && ckWARN(WARN_IO))
> Perl_croak(aTHX_ no_prev_lstat);
That croak only happens when warnings are on. Warnings are just
supposed to be warnings, unless the ‘user’ explicitly requests
fatal warnings.
$ perl -le 'print "foo", -l -e "miniperl"'
foo
$ perl -lwe 'print "foo", -l -e "miniperl"'
The stat preceding -l _ wasn't an lstat at -e line 1.
That it doesn’t die in the first example is a bug.
In fact, it’s using the return value of -e as a file name:
$ ln -s miniperl 1
$ ./miniperl -le 'print -l -e "miniperl"'
1
And, with warnings on, if the preceding stat *was* an lstat, it
falls back to the pre-stacked behaviour, just as it does when warn-
ings are off.
It’s meant to be equivalent to -e "miniperl" && -l _ (which is why the
error message above says ‘The stat preceding -l _’).
|
|
|
|
|
|
|
|
|
| |
On some systems, csh croaks if the LS_COLORS envvar contains something
it considers invalid.
The easiest and least intrusive fix for now is to localize %ENV before
running csh, though eventually it might be nice to use File::Glob in
miniperl, either by linking it statically or by inlining it.
|
|
|
|
|
| |
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.
|
|
|
|
| |
It used to ignore get-magic for globs and globrefs.
|
|
|
|
|
|
| |
This patch uses the recently-added MAYBE_DEREF_GV macro which puts the
glob deref logic in one spot. It also adds _nomg and _flags varia-
tions of it. _flags understands the SV_GMAGIC flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ln -s /usr/bin/perl bar
$ perl -le' print "bar", -l foo'
1
The -l ate my bar.
It’s this naughty piece of code in doio.c:Perl_my_lstat_flags that is
the culprit:
if (ckWARN(WARN_IO)) {
Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
GvENAME(cGVOP_gv));
return (PL_laststatval = -1);
}
When -l is followed by a bareward, it has no argument on the stack,
but the filetest op itself is a gvop. That snippet is from the bare-
word-handling code.
So, if warnings are off, it falls through to the argument-on-the-stack
code and pops off something does not belong to it (that belong to the
print, in the example above).
|
|
|
|
|
| |
Remove support for the Borland C++ compiler on Win32, as agreed here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
|
|
|
|
|
|
|
|
| |
Following on from commit 935647290357b277, which corrected the beha-
viour for tied globs, this commit corrects the behaviour for refer-
ences to tied globs.
(With tests by Nicholas Clark.)
|
|
|
|
|
|
|
|
| |
When the chdir(*handle) feature was added in 5.8.8, the fact that
globs and refs could be magical was not taken into account.
They can easily be magical if a typeglob or reference is returned from
or assigned to a tied variable.
|
|
|
|
|
|
|
| |
This new function looks for problematic code points on output, and warns if any
are found, returning FALSE as well.
What it warns about may change, so is marked as experimental.
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
| |
Simplify tests of !gv || !io to just !io, avoid calling GvIO(gv) more than
once, and where possible initialise io at declaration time, to allow it to be
const.
|
|
|
|
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
Removing the check from Perl_do_close() does not change behaviour, as io is
NULL there, hence Perl_report_evil_fh() will always be checking WARN_UNOPENED
and setting vile to "unopened".
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
|
| |
|
| |
|
|
|
|
|
| |
Previously Perl_report_evil_fh()'s body was just an if/else at the top level -
a good sign that it is actually implementing two disjoint functions.
|
| |
|
| |
|
|
|
|
|
|
|
| |
my_stat() and my_lstat() call get magic on the stack arg, so create _flags()
variants that allow us to control this. (I can't just change the signature
or the mg_get() behaviour since my_[l]stat() are listed as being in the
public API, even though they're undocumented.)
|
|
|
|
|
|
| |
The code was checking flags with applying any get magic, so when a
match was doing putting a numeric string into $1, none of the flags
checked were set, so producing the "non-numeric process ID" error.
|
|
|
|
|
|
| |
This ensures that (safe) signals sent to the same process are still dispatched
within the same statement (as before), without overloading the semantics of
block popping.
|
|
|
|
|
|
|
| |
Change f6c77cf1bf4d7cb2c7a64dd7608120b471f84062 introduced
open($fh,"+<",undef)
but in the process stopped calling mg_get() on the third arg,
so tied values etc weren't getting processed
|
|
|
|
|
|
|
|
|
| |
Stable cygwin patch for root filetests (gid 0 root <= gid 544 Administrators).
On cygwin check for the Administrators group (544) which has root
rights regarding -r filetests.
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
|
| |
|
|
|
|
|
| |
Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code
size for 1 more function call if warnings are not enabled.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As the debate over the best way to deal with floating point
pids stalled, this is just for non-numeric, which at least
squashes the bug even if it's not the Platonic ideal for
everyone.
It also doesn't address overloaded objects that might not have
IV, NV or PV appropriately set, but the approach mirrors what is
done elsewhere in doio.c so I recommend applying this patch now and
fixing the problem of overloaded objects at some other time when
it can be done more globally, either through an improvement or
replacement of looks_like_number
Also updated POD for kill when process is 0 or negative and
fixed Test-Harness tests that used kill with a string pid.
(Test-Harness test fix also submitted upstream)
|
|
|
|
| |
matching entry in perldiag (and fix it so that more of the existing ones do).
|
| |
|
|
|
|
|
|
|
|
| |
(MacOS support was removed from MakeMaker in 6.22, and merged to blead on
15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this
point MacOS wouldn't even have been able to build the perl binary, because it
would not have been able to build DynaLoader. If anyone wishes to resurrect
MacOS, start by reversing this commit and the relevant part of that commit.)
|
|
|
|
|
|
| |
Make sure the size argument to shmget() is not limited by the width of an int.
Instead of storing the argument in an int, just store a pointer to the SV and
use different conversions for semget() and shmget().
|
|
|
| |
p4raw-id: //depot/perl@35088
|
|
|
|
|
|
|
| |
Message-ID: <20081201230112.GH31089@tytlal.topaz.cx>
Use mode 0600 (minus umask) for creation of the new file with -i
p4raw-id: //depot/perl@35082
|
|
|
|
|
| |
Message-ID: <20081127070141.GD17663@tytlal.topaz.cx>
p4raw-id: //depot/perl@35018
|
|
|
| |
p4raw-id: //depot/perl@34934
|
|
|
|
|
| |
Wrap gen_constant_list in #if defined(PERL_IN_OP_C)
p4raw-id: //depot/perl@34925
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
|
|
|
| |
Can't easily do gv.h, as GvGP() (at least) needs to split into two
macros - one const for reading, one non-const for writing.
p4raw-id: //depot/perl@34679
|
|
|
| |
p4raw-id: //depot/perl@34654
|
|
|
| |
p4raw-id: //depot/perl@34653
|
|
|
| |
p4raw-id: //depot/perl@34585
|
|
|
|
|
| |
Message-ID: <20080628160017.GA81579@osiris.mauzo.dyndns.org>
p4raw-id: //depot/perl@34092
|
|
|
|
|
|
| |
From: "Vincent Pit" <perl@profvince.com>
Message-ID: <63615.92.128.97.94.1209490401.squirrel@92.128.97.94>
p4raw-id: //depot/perl@33766
|
|
|
|
|
|
|
|
| |
times? */
From: "Vincent Pit" <perl@profvince.com>
Message-ID: <37048.147.210.17.175.1202998889.squirrel@147.210.17.175>
p4raw-id: //depot/perl@33310
|
|
|
|
|
|
|
|
|
|
|
|
| |
ability to create landmines that will explode under someone in the
future when they upgrade their compiler to one with better
optimisation. We've already done this at least twice.
(Yes, some of the assertions are after code that would already have
SEGVd because it already deferences a pointer, but they are put in
to make it easier to automate checking that each and every case is
covered.)
Add a tool, checkARGS_ASSERT.pl, to check that every case is covered.
p4raw-id: //depot/perl@33291
|
|
|
|
|
|
| |
the flags. Move its implementation just ahead of sv_2mortal()'s for
CPU cache locality. Refactor all code that can be to use this.
p4raw-id: //depot/perl@32818
|
|
|
|
|
|
| |
From: "Robin Barker" <Robin.Barker@npl.co.uk>
Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399A@exchsvr2.npl.ad.local>
p4raw-id: //depot/perl@32681
|