| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
/tmp, or wherever tempdir happens.
Happened in IRIX, but applicable anywhere.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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();'
|
|
|
|
| |
and before we do much processing
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The previous commit added macros to do some case changing. This
commit uses them in the core, where appropriate.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
t/TEST may appear in upper or lower case and with or without a
trailing dot depending on various Unix compatibility settings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
MPE/iX was a business-oriented minicomputer operating system made by
Hewlett-Packard. Support from HP terminated at the end of 2010.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
following commit ffa23acf6.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
These are left over from the refactoring that took place
with commit 1bb8785a.
|
|
|
|
| |
(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.
|