summaryrefslogtreecommitdiff
path: root/ext/File-Glob
Commit message (Collapse)AuthorAgeFilesLines
* /tmp can have (low) quotas on the number of files.Jarkko Hietaniemi2014-10-191-5/+16
| | | | | | /tmp, or wherever tempdir happens. Happened in IRIX, but applicable anywhere.
* File-Glob/t/basic.t: avoid race conditionDavid Mitchell2014-04-061-0/+6
| | | | | | | | | | | | Test 2 does a glob('*') in the t/ directory, and compares that with the results of readdir('.'). If we're doing parallel testing, temporary files and stuff may get created in t/, resulting in a race condition and occasional random failures. Fix this by chdir()ing to t/base/ first. The timestamp on this directory on my system seems to indicate that nothing currently creates tmp files in that dir, and given that these are basic tests, that's relatively unlikely to change.
* Compliance: Mixed declarations not allowed in some pre-C99 compilersH.Merijn Brand2013-11-141-3/+3
|
* File::Glob: fix warnings and non-\0-ended stringsDavid Mitchell2013-11-132-4/+14
| | | | | | | | | | | The lower levels of File::Glob expect null-terminated strings, while the higher levels do s = SvPV(sv,len) and pass the len. Ease the impedance mismatch by ensuring that s[len] is always \0. Most perl SVs will already have that \0 anyway, so in practice this hasn't been an issue. It also ignores the utf8-ness of the string. I've kept that as-is (too big a can of works to open for now), but I've fixed the 'is_utf8 var not used' warning and added an XXX comment instead.
* File::Glob: silence some compiler warningsDavid Mitchell2013-11-131-4/+13
| | | | | | | | | | | | | | In bsd_glob.c, there are nested set of functions glob0(), glob1() etc, which among their parameters pass a pointer to a compiled pattern, and also to its end. It turns out the end pointer isn't usually used, since the pattern is usually scanned for BG_EOS instead. Also, glob3() is passed two pattern ranges, both within the same pattern, and both with the same pointer to the end of the pattern buffer. Since both end pointers are the same, eliminate one of them. This removed an unused var compiler warning. Use the remaining end pointer in the glob*() functions to add assertions that we haven't fallen off the end of the buffer. Finally, ARG_MAX may be signed.
* Fix ext/File-Glob/t/threads.t filenames for VMS.Craig A. Berry2013-10-011-1/+1
| | | | | | | | | As noted in http://www.nntp.perl.org/group/perl.perl5.porters/2013/09/msg208134.html zero-length extensions always get a trailing dot on VMS, and the easiest workaround is to always use an explicit extension.
* File::Glob::VERSION++Brian Fraser2013-09-271-1/+1
|
* File::Glob: Dup glob state in CLONE()Brian Fraser2013-09-272-0/+104
| | | | | | | | | | | This solves [perl #119897] and [perl #117823], and restores the behavior of glob() in conjunction with threads of 5.14 and older. Since 5.16, code that used glob() inside a thread had been unintentionally sharing state between threads, which lead to things like this crashing and failing assertions: ./perl -Ilib -Mthreads -e 'scalar glob("*"); threads->create(sub { glob("*") })->join();'
* [perl #117265] do most glob \0 checks in the same placeTony Cook2013-09-091-30/+38
| | | | and before we do much processing
* [perl #117265] correctly handle overloaded stringsTony Cook2013-09-091-5/+6
|
* [perl #117265] safesyscalls: check embedded nul in syscall argsTony Cook2013-08-262-2/+4
| | | | | | | | | | | | | | | | Check for the nul char in pathnames and string arguments to syscalls, return undef and set errno to ENOENT. Added to the io warnings category syscalls. Strings with embedded \0 chars were prev. ignored in the syscall but kept in perl. The hidden payloads in these invalid string args may cause unnoticed security problems, as they are hard to detect, ignored by the syscalls but kept around in perl PVs. Allow an ending \0 though, as several modules add a \0 to such strings without adjusting the length. This is based on a change originally by Reini Urban, but pretty much all of the code has been replaced.
* Use new case changing macrosKarl Williamson2013-05-201-2/+2
| | | | | The previous commit added macros to do some case changing. This commit uses them in the core, where appropriate.
* File::Glob: Drop dependency on given/whenBrian Fraser2013-03-261-15/+19
|
* Remove the BeOS port.Nicholas Clark2012-12-141-1/+1
| | | | | | | | | BeOS was an operating system for personal computers developed by Be Inc, initially for their BeBox hardware. The OS Haiku was written as an open source replacement/continuation for BeOS, and its perl port is current and actively maintained. The BeOS port has not been updated since 2004.
* {Dos,}Glob.xs: Skip freeing during global destructionFather Chrysostomos2012-12-121-0/+3
| | | | | | | | | | | | See ticket #116064. File::Glob and ::DosGlob free data associated with a calling op when that op is freed. During global destruction, there is no need to do that, as it will be freed anyway. Also, during sv_clean_all dMY_CXT can cause us to read freed memory.
* Glob.xs: PL_opfreehook is an interpreter variableFather Chrysostomos2012-12-111-7/+4
| | | | | | Hence, there is no need to lock a mutex; also storing the old value in a C static is bad. It needs to be in a spot local to the current interpreter, which MY_CXT provides.
* Don’t leak when partly iterated glob op is freedFather Chrysostomos2012-12-091-0/+17
| | | | | | | | | | File::Glob keeps its own hash of arrays of file names. Each array corresponds to one call site. When iteration finishes, it deletes the array. But if iteration never finishes, and the op at the call site is freed, the array remains. So eval "scalar<*>" will cause a memory leak. We already have a mechanism for hooking the freeing of ops. So File::Glob can use that.
* Increase $File::Glob::VERSION to 1.19Father Chrysostomos2012-12-091-1/+1
|
* Stop using PL_glob_index for PL_globhookFather Chrysostomos2012-12-091-10/+2
| | | | | | If Glob.xs just uses the address of PL_op as its iterator key all the time (when called via PL_globhook too, not just via a glob override), the code is simpler.
* File::Glob: Don’t use the magic 2nd arg to globFather Chrysostomos2012-12-092-11/+9
| | | | | | | See the previous commit. The same applies to File::Glob as well. In short, the easiest way to fix a memory leak involves using the address of the glob op rather than a special glob index.
* Remove "register" declarationsKarl Williamson2012-11-241-14/+14
| | | | | | | This finishes the removal of register declarations started by eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in function parameter declarations, and didn't include things in dist, ext, and lib, which this does include
* Fix test-skipping logic for File::Glob under no-taint-perlSteffen Mueller2012-11-191-2/+2
|
* Fix VMS-specific case nit in File::Glob's basic.t.Craig A. Berry2012-11-111-1/+2
| | | | | t/TEST may appear in upper or lower case and with or without a trailing dot depending on various Unix compatibility settings.
* Skip non-functional glob test on VMS.Craig A. Berry2012-11-061-1/+7
|
* Add C define to remove taint support from perlSteffen Mueller2012-11-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By defining NO_TAINT_SUPPORT, all the various checks that perl does for tainting become no-ops. It's not an entirely complete change: it doesn't attempt to remove the taint-related interpreter variables, but instead virtually eliminates access to it. Why, you ask? Because it appears to speed up perl's run-time significantly by avoiding various "are we running under taint" checks and the like. This change is not in a state to go into blead yet. The actual way I implemented it might raise some (valid) objections. Basically, I replaced all uses of the global taint variables (but not PL_taint_warn!) with an extra layer of get/set macros (TAINT_get/TAINTING_get). Furthermore, the change is not complete: - PL_taint_warn would likely deserve the same treatment. - Obviously, tests fail. We have tests for -t/-T - Right now, I added a Perl warn() on startup when -t/-T are detected but the perl was not compiled support it. It might be argued that it should be silently ignored! Needs some thinking. - Code quality concerns - needs review. - Configure support required. - Needs thinking: How does this tie in with CPAN XS modules that use PL_taint and friends? It's easy to backport the new macros via PPPort, but that doesn't magically change all code out there. Might be harmless, though, because whenever you're running under NO_TAINT_SUPPORT, any check of PL_taint/etc is going to come up false. Thus, the only CPAN code that SHOULD be adversely affected is code that changes taint state.
* Remove the MPE/iX port.Nicholas Clark2012-09-211-1/+1
| | | | | MPE/iX was a business-oriented minicomputer operating system made by Hewlett-Packard. Support from HP terminated at the end of 2010.
* Increase $File::Glob::VERSION to 1.18Father Chrysostomos2012-09-201-1/+1
|
* [perl #114984] Glob.xs: Extend stack when returningFather Chrysostomos2012-09-202-0/+26
| | | | | | | | | If a pattern passed to File::Glob consists of a space-separated list of patterns, the stack will only be extended by doglob() enough for the list returned by each subpattern. So iterate() needs to extend the stack before copying the list of files from an AV to the stack. This fixes a regression introduced in 5.16.0.
* Revert "Increase the fallback value of MAXPATHLEN"Dominic Hargreaves2012-02-181-1/+1
| | | | | | | | This reverts commit ffa23acf6bf9670bd1d5fdc9a958c918b6cf3d06. This change was made without realisation that the fallback value for MAXPATHLEN on POSIX systems comes (in perl.h) from _POSIX_MAX_PATH, so the fallback value here was not used.
* Increase $File::Glob::VERSION to 1.17Father Chrysostomos2012-01-311-1/+1
| | | | following commit ffa23acf6.
* Increase the fallback value of MAXPATHLENDominic Hargreaves2012-01-301-1/+1
| | | | | | On systems without MAXPATHLEN or PATH_MAX defined (GNU/Hurd is an example of such a system), set MAXPATHLEN to 4096 rather than 1024; this increase creates parity with Linux.
* [perl #107296] Document File::Glob’s default flagsFather Chrysostomos2011-12-301-2/+21
|
* Increase $File::Glob::VERSION to 1.16Father Chrysostomos2011-12-301-1/+1
|
* Version bumpsif-0.0602Father Chrysostomos2011-11-221-1/+1
|
* [RT #36079] Convert ` to '.jkeenan2011-11-223-3/+3
|
* expunge gratuitous Unicode punctuation in commentsZefram2011-11-161-1/+1
|
* Glob.xs: remove unused varsFather Chrysostomos2011-11-051-4/+0
| | | | | These are left over from the refactoring that took place with commit 1bb8785a.
* 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.