| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This was something e1dccc0d3 removed that b82b06b8 failed to restore.
|
|
|
|
|
|
|
|
| |
arybase was changing $[=1 to $arybase::[ = 1 to avoid any run-time
effects. In case this module is ever dual-lifed, we ought to avoid
punctuation variables even outside the main stash. See bug #76138.
This is a classic example of paranoia.
|
|
|
|
|
|
|
| |
Check that $[ is in the main stash before doing anything magical with
$[=1. This can only be in another stash if some other XS module has
overridden the check functions to change $[ to $foo::[. But robust-
ness is good, right?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Usually when a BEGIN block exits it has to set PL_curcop to
&PL_compiling, so that subsequent compiled code in the surrounding
scope will have the right warning hints during compilation.
If an XS function creates a BEGIN block via newXS or newATTRSUB, how-
ever, the assumption that compilation will resume as soon as the block
exits is false.
This can be demonstrated with this code, which warns about CHECK and
INIT blocks created too late when it shouldn’t due to ‘no warnings’:
use warnings;
eval q|
BEGIN{
no warnings;
package XS::APItest; require XSLoader; XSLoader::load()
}
|;
In every case where it is correct for BEGIN to set PL_curcop to
&PL_compiling when it exits it is actually just restoring it to its
previous value, so localisation is the right fix.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
When a filter is added, the current buffer is hung on the end of
the filters array, and a new substring of it becomes the current
buffer.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This function evaluates its argument as a byte string, regardless of
the internal encoding. It croaks if the string contains characters
outside the byte range. Hence evalbytes(" use utf8; '\xc4\x80' ")
will return "\x{100}", even if the original string had the UTF8 flag
on, and evalbytes(" '\xc4\x80' ") will return "\xc4\x80".
This has the side effect of fixing the deparsing of CORE::break under
‘use feature’ when there is an override.
|
|
|
|
|
|
| |
Source filters have always been byte-level filters. Therefore they
don’t make sense on Unicode strings, unless we are planning to add
new APIs to support it. Until then, croak.
|
|
|
|
|
| |
These are left over from the refactoring that took place
with commit 1bb8785a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
currently, there are few tests failing because of a broken NDBM module;
using the same hints as used on Linux (given that apparently the cause
is the same) makes the following tests pass:
t/op/dbm.t
cpan/autodie/t/dbmopen.t
cpan/Memoize/t/errors.t
cpan/Memoize/t/tie_ndbm.t
ext/NDBM_File/t/ndbm.t
lib/AnyDBM_File.t
Dominic Hargreaves adds: Note that the original git commit log [what
you see above] lists some tests which aren't affected in blead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Bug-Debian: http://bugs.debian.org/636609
Patch-Name: fixes/hurd-hints.diff
With minor modifications to add Pino to AUTHORS.
|
|
|
|
| |
(except after e.g.)
|
|
|
|
| |
These have been obsolete since commit e37778c28b in 2009.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It has been redundant since 1bb8785a (when bsd_glob was still
called doglob).
|
| |
|
|
|
|
| |
This was obsoleted by commit f4cbf9907d.
|
| |
|
|
|
|
|
| |
Since this is XS code, we don’t have to store array references in
a hash. We can just store the arrays themselves.
|
|
|
|
| |
This not longer applies really, as I’ve significantly modified it.
|
|
|
|
| |
This happens under :bsd_glob when <>/glob is called in list context.
|
|
|
|
|
| |
There is no need to keep a separate scalar to remember the number of
items in an array. We can just use the array.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It was reading one byte too far, and looking at the trailing null.
This happened only in the case of an unmatched quote.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
It only existed to work around an ExtUtils::MakeMaker problem that is
now fixed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
I forgot about the default PERL_EXTERNAL_GLOB setting on VMS and the
special treatment of backslashes on Windows in bsd_glob.c.
|
|
|
|
| |
<...> is a double-quotish construct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
File::Glob::csh_glob, which is the routine implementing Perl’s own
glob function, is not consistent in its treatment of quotation marks
and backslashes. It differs depending on whether there are white-
space characters in the pattern both preceded and followed by non-
whitespace.
Without whitespace, quotation marks are treated literally and back-
slashes are treated as escapes that cause metacharacters to be treated
literally. So
<"foo*">
looks for files with literal quotation marks in their name.
With whitespace, quotation marks are treated as word delimiters, so
<"foo copy*">
will find file names matching /^foo copy/. Backslash escapes are pro-
cessed twice, so one has to write
glob '\\\** .\\\**'
to find files beginning with a literal ‘*’ or ‘.*’. But simply
glob '\**'
to find files beginning with ‘*’. (Note that <> is a double-quotish
operator, so in <> those would have to be quadruple and double back-
slashes, respectively.)
There are two problems with the code:
1) Text::Parsewords is only used when there is whitespace present. It
should be used also for quotation marks, too, if they exist.
2) Text::Parsewords should not be removing backslash escapes.
3) Actually, there’s a third. A final escaped space should also go
through Text::ParseWords, instead of being stripped.
This commit fixes both things.
|
|
|
|
| |
TonyC: add new ipv6_mreq.t test script to MANIFEST
|
| |
|
|
|
|
| |
C++ requires a cast to convert from void * to other types.
|
|
|
|
|
|
|
|
|
|
| |
This stops PL_curstash from pointing to a freed-and-reused scalar in
cases like ‘package Foo; BEGIN {*Foo:: = *Bar::}’.
In such cases, another BEGIN block, or any subroutine definition,
would cause a crash. Now it just happily proceeds. newATTRSUB and
newXS have been modified not to call mro_method_changed_in in such
cases, as it doesn’t make sense.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit reimplements $[ using PL_check hooks, custom pp func-
tions and ties.
Outside of its compile-time use, $[ is now parsed as a simple varia-
ble, so function calls like foo($[) are permitted, which was not the
case with the former implementation removed by e1dccc0. I consider
that a bug fix.
The ‘That use of $[ is unsupported’ errors are out of necessity
deferred to run-time and implemented by a tied $[.
Indices between 0 and the array base are now treated consistently, as
are indices between a negative array base and zero. That, too, is
a bug fix.
|