summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Re-deprecate $[Father Chrysostomos2011-11-1713-11/+15
| | | | This was something e1dccc0d3 removed that b82b06b8 failed to restore.
* arybase.xs: Don’t use arybase::[Father Chrysostomos2011-11-171-1/+1
| | | | | | | | 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.
* arybase.xs: Check that $[ is in the main stashFather Chrysostomos2011-11-171-0/+1
| | | | | | | 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?
* Localise PL_curcop for BEGIN blocksFather Chrysostomos2011-11-172-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* avoid some test-time warningsZefram2011-11-161-0/+1
|
* \x-ify non-ASCII chars in C string literalZefram2011-11-162-3/+3
|
* expunge gratuitous Unicode punctuation in commentsZefram2011-11-161-1/+1
|
* Make source filters work in evalbytesFather Chrysostomos2011-11-061-3/+12
| | | | | | 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.
* Add new OPpEVAL flags to B::ConciseFather Chrysostomos2011-11-061-1/+1
|
* Increase $B::Concise::VERSION to 0.87Father Chrysostomos2011-11-061-1/+1
|
* Add evalbytes functionFather Chrysostomos2011-11-061-1/+1
| | | | | | | | | | | 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.
* Forbid source filters in Unicode evalsFather Chrysostomos2011-11-061-1/+10
| | | | | | 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.
* Glob.xs: remove unused varsFather Chrysostomos2011-11-051-4/+0
| | | | | These are left over from the refactoring that took place with commit 1bb8785a.
* Add GNU/Hurd hints for NDBM_FilePino Toscano2011-11-041-0/+1
| | | | | | | | | | | | | | | 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.
* Fix hang in ext/POSIX/t/sysconf.t on GNU/HurdPino Toscano2011-11-041-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Errno does not escape archnameReini Urban2011-11-021-3/+7
| | | | | | | 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
* Improve general GNU hints, needed for GNU/Hurd.Pino Toscano2011-10-311-0/+1
| | | | | | | | Bug-Debian: http://bugs.debian.org/636609 Patch-Name: fixes/hurd-hints.diff With minor modifications to add Pino to AUTHORS.
* File::Glob: Consistent use of spaces after dotsFather Chrysostomos2011-10-291-4/+4
| | | | (except after e.g.)
* File::Glob: Remove docs specific to Mac ClassicFather Chrysostomos2011-10-291-40/+0
| | | | These have been obsolete since commit e37778c28b in 2009.
* Document File::Glob::csh_globFather Chrysostomos2011-10-291-0/+5
| | | | | | | | | | | | | | 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.
* Glob.xs: Remove dMY_CXT from bsd_globFather Chrysostomos2011-10-291-2/+0
| | | | | It has been redundant since 1bb8785a (when bsd_glob was still called doglob).
* Glob.xs: Clarify commentFather Chrysostomos2011-10-291-1/+2
|
* Glob.xs: Remove commentFather Chrysostomos2011-10-291-4/+0
| | | | This was obsoleted by commit f4cbf9907d.
* Glob.xs: constingFather Chrysostomos2011-10-291-2/+2
|
* Glob.xs: Be more parsimonious with SVsFather Chrysostomos2011-10-291-16/+7
| | | | | Since this is XS code, we don’t have to store array references in a hash. We can just store the arrays themselves.
* Glob.xs: Remove commentFather Chrysostomos2011-10-291-1/+0
| | | | This not longer applies really, as I’ve significantly modified it.
* Oops: Fix Glob.xs assertion failureFather Chrysostomos2011-10-292-3/+6
| | | | This happens under :bsd_glob when <>/glob is called in list context.
* Glob.xs: Eliminate x_GLOB_ITERFather Chrysostomos2011-10-291-11/+2
| | | | | There is no need to keep a separate scalar to remember the number of items in an array. We can just use the array.
* Document File::Glob’s :bsd_glob tagFather Chrysostomos2011-10-291-2/+25
|
* Add :bsd_glob export tag to File::Glob [perl #96116]Father Chrysostomos2011-10-293-2/+84
| | | | | | | | | | | | | | | | | | 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.
* Glob.xs: Refactor iteration into separate functionFather Chrysostomos2011-10-281-32/+54
| | | | | | 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.
* Stop csh_glob from reading past end of stringFather Chrysostomos2011-10-271-1/+1
| | | | | It was reading one byte too far, and looking at the trailing null. This happened only in the case of an unmatched quote.
* Make csh_glob remove quote-escaping backslashesFather Chrysostomos2011-10-272-4/+28
| | | | | | | | | | | | | | | | | | | | | 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.
* File::Glob: short-circuit earlier for list cxFather Chrysostomos2011-10-271-2/+2
| | | | | | | | | | | 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.
* File::Glob: Eliminate the doglob alias to bsd_globFather Chrysostomos2011-10-271-6/+2
| | | | | | | | 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.
* Test $x=wait under arybaseFather Chrysostomos2011-10-261-0/+3
|
* arybase.xs: Always check the op type in ck_*Father Chrysostomos2011-10-261-4/+4
| | | | | | | | | 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).
* arybase.xs: Remove extraneous semicolonFather Chrysostomos2011-10-261-1/+1
|
* Remove arybase’s Makefile.PLFather Chrysostomos2011-10-261-16/+0
| | | | | It only existed to work around an ExtUtils::MakeMaker problem that is now fixed
* Fix CORE::globFather Chrysostomos2011-10-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Rewrite csh_glob in C; fix two quoting bugsFather Chrysostomos2011-10-263-80/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Speed up csh_globFather Chrysostomos2011-10-261-21/+21
| | | | | | | | 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.
* Make new basic.t glob tests work on Win & VMSFather Chrysostomos2011-10-241-4/+7
| | | | | I forgot about the default PERL_EXTERNAL_GLOB setting on VMS and the special treatment of backslashes on Windows in bsd_glob.c.
* Correct comment in Glob.pmFather Chrysostomos2011-10-241-1/+1
| | | | <...> is a double-quotish construct.
* Make File::Glob::csh_glob consisent wrt '"\Father Chrysostomos2011-10-242-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add unit tests for Socket::{pack,unpack}_ipv6_mreqPaul \"LeoNerd\" Evans2011-10-241-0/+26
| | | | TonyC: add new ipv6_mreq.t test script to MANIFEST
* Wrap some IPv6 sockopt constants and ipv6_mreq structurePaul \"LeoNerd\" Evans2011-10-243-1/+79
|
* fix g++ build breakage introduced in 03d9f026ae25Tony Cook2011-10-242-7/+7
| | | | C++ requires a cast to convert from void * to other types.
* [perl #101486] Make PL_curstash refcountedFather Chrysostomos2011-10-222-3/+3
| | | | | | | | | | 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.
* Reimplement $[ as a moduleFather Chrysostomos2011-10-2117-0/+1260
| | | | | | | | | | | | | | | | | 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.