Karl Williamson [Sun, 25 Dec 2011 21:32:56 +0000 (14:32 -0700)]
re/reg_fold.t: Test more code points
This statement was wrong that said all these things are tested in
fold_grind.t. It will test them all when run with a particular option,
but due to time issues, it skips many code points. reg_fold.t, on the
other hand, does just basic sanity testing, and so should always test
every code point for that.
Karl Williamson [Sun, 25 Dec 2011 21:30:20 +0000 (14:30 -0700)]
re/reg_fold.t: Remove fixed TODOs
These TODOs have not been tested, mostly, for a while
Karl Williamson [Sun, 25 Dec 2011 21:24:42 +0000 (14:24 -0700)]
re/reg_fold.t: Use /u rules for Unicode tests
These tests are for Unicode, so should have /u (instead of /d).
Karl Williamson [Sun, 25 Dec 2011 21:20:42 +0000 (14:20 -0700)]
regcomp.c: Refactor join_exact() to eliminate extra passes
The strings in every EXACTFish node are examined for certain problematic
sequences and code points. Prior to this patch, this was done in
several passes, but this refactors the routine to do it in a single
pass.
Karl Williamson [Sun, 25 Dec 2011 21:18:55 +0000 (14:18 -0700)]
regcomp.c: Modify some comments
Karl Williamson [Sat, 24 Dec 2011 03:19:27 +0000 (20:19 -0700)]
regex: Remove FOLDCHAR regnode type
This node type hasn't been used since 5.14.0. Instead an ANYOFV node
was generated where formerly a FOLDCHAR node would have been used. The
ANYOFV was used because it already existed and was up-to-date, whereas
FOLDCHAR would have needed some bug fixes to adapt it, even though it
would be faster in execution than ANYOFV; so the code for it was
retained in case it was needed.
However, both these solutions were defective, and a previous commit has
changed things to a different type of solution entirely. Thus FOLDCHAR
is obsolescent and can be removed, though the code in it was used as a
base for some of the new solutions.
Karl Williamson [Sat, 24 Dec 2011 03:11:22 +0000 (20:11 -0700)]
regex: Fix some tricky fold problems
As described in the comments, this changes the design of handling the
Unicode tricky fold characters to not generate a node for each possible
sequence but to get them to work within EXACTFish nodes.
The previous design(s) all used a node to handle these, which suffers
from the downfall that it precludes legitimate matches that would cross
the node boundary.
The new design is described in the comments.
Karl Williamson [Sat, 24 Dec 2011 02:46:10 +0000 (19:46 -0700)]
regcomp.c: Rework join_exact()
This re formats and refactors portions of join_exact() that look for the
tricky Greek fold sequences. I renamed various variables, etc, to help
me understand what was going on. It turns out that there were two
off-by-one bugs that prevented this from working properly.
The first bug had the loop quit one too soon The boundary should be
"<=", and not strictly less-than. This means that if the sequence is
the last thing in the string (or only thing) it will not be found.
The other bug had the end-needle parameter be 1 too short, which means
that this would succeed with only the first 3 bytes of the sequence
(now called 'tail'), thus matching many more things than it should
(provided it got the chance to match at all given the first bug).
Karl Williamson [Sat, 24 Dec 2011 02:37:36 +0000 (19:37 -0700)]
regex: Add new node type EXACTFU_NO_TRIE
This new node is like EXACTFU but is not currently trie'able. This adds
handling for it in regexec.c, but it is not currently generated; this
commit is preparing for future commits
Karl Williamson [Sat, 24 Dec 2011 02:30:09 +0000 (19:30 -0700)]
regex: Add new node type EXACTFU_SS
This node will be used to distinguish between the case in a non-UTF8
pattern and string where something could be matched that is of different
lengths. The only instance where this can happen is the LATIN SMALL
LETTER SHARP S can match the sequences "ss", "Ss", "sS", or "SS", hence
the name.
This node is not currently generated; this prepares for future commits
Karl Williamson [Sat, 24 Dec 2011 02:13:24 +0000 (19:13 -0700)]
regcomp.c: Need to account for delta sizes
When a node can match varying sizes, the delta variable in the optimizer
needs to change to account for that, and it can no longer match a fixed
length string.
This code was adapted from the existing code for the FOLDCHAR node that
has to deal with the same problem.
Karl Williamson [Sat, 24 Dec 2011 01:51:45 +0000 (18:51 -0700)]
regcomp.c: Change param to join_exact()
This changes a parameter to this function to instead of changing a running
total, return the actual value computed by the function; and it changes
the calling areas of code to compensate.
Karl Williamson [Fri, 23 Dec 2011 19:24:09 +0000 (12:24 -0700)]
regcomp.c: regex start class for sharp s
Under most folding types, the optimizer start class should include all
of s, S, and the sharp s (\xdf) if it includes any of them. The code
was neglecting the latter. This is currently not relevant, as there is
special handling of the sharp s elsewhere in regcomp.c. But this is a
step to changing that special handling to fix some bugs.
Karl Williamson [Fri, 23 Dec 2011 15:48:07 +0000 (08:48 -0700)]
regcomp.c: white-space only and comments only
Karl Williamson [Fri, 23 Dec 2011 15:42:17 +0000 (08:42 -0700)]
regcomp.c: Save computed value in variable for later use
This will be used in future commits. Retrieving it via OP() doesn't
work in pass1 of the regex compiler.
Karl Williamson [Fri, 23 Dec 2011 03:09:11 +0000 (20:09 -0700)]
regcomp.c: Make sure trie can handle node passed to it
Karl Williamson [Fri, 23 Dec 2011 03:03:55 +0000 (20:03 -0700)]
regexec.c: white space only
Karl Williamson [Fri, 23 Dec 2011 02:51:37 +0000 (19:51 -0700)]
regexec.c: EXACTF nodes can never be UTF
By definition a regex pattern that is in UTF-8 uses Unicode matching
rules, and EXACTF is non-Unicode (unless the target string is UTF-8).
Therefore an EXACTF node will never be generated for a UTF-8 pattern,
and there is no need to test for it being so.
Karl Williamson [Thu, 22 Dec 2011 21:29:12 +0000 (14:29 -0700)]
regexp_noamp.t: Add comment
Karl Williamson [Wed, 21 Dec 2011 16:57:43 +0000 (09:57 -0700)]
t/re/re_tests: Add some tests
Karl Williamson [Wed, 21 Dec 2011 16:54:38 +0000 (09:54 -0700)]
t/re/re_tests: revise test
This is the wrong test for the cited ticket. That one is for tests
occurring in bracketed character classes.
Karl Williamson [Wed, 21 Dec 2011 16:53:41 +0000 (09:53 -0700)]
t/re/re_tests: Update comment
This reflects that now that there is autoloading of \N{}, such tests can
go in this file
Karl Williamson [Tue, 20 Dec 2011 16:28:47 +0000 (09:28 -0700)]
util.c: Add comment
Karl Williamson [Sun, 18 Dec 2011 20:27:06 +0000 (13:27 -0700)]
regcomp.c: Don't print incorrect debug info
The break out of the loop should be done before the debug statements
that indicate the things that happen only if the break isn't done.
Karl Williamson [Sun, 18 Dec 2011 19:22:11 +0000 (12:22 -0700)]
regcomp.sym: Change comments
Shlomi Fish [Wed, 11 Jan 2012 18:21:20 +0000 (20:21 +0200)]
perl5db.t: add the DebugWrap class
This helper encapsulates a bit of repeated code in the debugger
tests to avoid quite so much copying and pasting.
Steffen Schwigon [Tue, 17 Jan 2012 14:17:13 +0000 (14:17 +0000)]
Bump several file copyright dates
Sync copyright dates with actual changes according to git history.
[Plus run regen_perly.h to update the SHA-256 checksums, and
regen/regcharclass.pl to update regcharclass.h]
Steffen Mueller [Thu, 19 Jan 2012 16:58:49 +0000 (17:58 +0100)]
EU::Typemaps: Helper module for easy typemap inclusion in XS
In order to be able to deprecate certain typemaps from the core and send
them to a peaceful retirement on the CPAN, it's necessary to make it
easy to share and include these typemaps in case they're used despite
CPAN greps claiming the opposite. This helper module facilitates
non-copy-and-paste sharing of typemaps by adding a dependency and
including a single line of code in the XS.
Chris 'BinGOs' Williams [Thu, 19 Jan 2012 16:46:28 +0000 (16:46 +0000)]
Removed more unused boilerplate from perldelta
Steffen Schwigon [Tue, 17 Jan 2012 10:26:13 +0000 (10:26 +0000)]
Bump the visible perl -V copyright to 2012
Nicholas Clark [Thu, 19 Jan 2012 13:23:33 +0000 (14:23 +0100)]
Add Steffen Schwigon to AUTHORS.
Steffen Mueller [Thu, 19 Jan 2012 07:46:54 +0000 (08:46 +0100)]
EU::Typemaps: Implement embedded-typemap dumping
This method will return a string representation of the typemap object
that can be included *verbatim* in an XS file.
Karl Williamson [Thu, 19 Jan 2012 04:10:07 +0000 (21:10 -0700)]
Typo in perlre
Spotted by Jim Avera
Chris 'BinGOs' Williams [Wed, 18 Jan 2012 23:06:41 +0000 (23:06 +0000)]
Begin battering the perldelta into shape for v5.15.7
Father Chrysostomos [Wed, 18 Jan 2012 21:34:43 +0000 (13:34 -0800)]
regen pod issues
Father Chrysostomos [Wed, 18 Jan 2012 21:34:24 +0000 (13:34 -0800)]
overload.pm: Smaller indents for long lines
Father Chrysostomos [Wed, 18 Jan 2012 21:32:32 +0000 (13:32 -0800)]
overload.pm: spaces after dots; wording tweak
Father Chrysostomos [Wed, 18 Jan 2012 21:20:44 +0000 (13:20 -0800)]
Document new overload warning in overload.pm
as well as perldiag.
Father Chrysostomos [Wed, 18 Jan 2012 21:18:58 +0000 (13:18 -0800)]
overload.pm: Doc tweaks
This sentence got mangled somehow, somewhen.
Father Chrysostomos [Wed, 18 Jan 2012 20:59:34 +0000 (12:59 -0800)]
Increase $overloading::VERSION to 0.02
Father Chrysostomos [Wed, 18 Jan 2012 18:58:19 +0000 (10:58 -0800)]
overloading.pm: Load Carp on demand
Father Chrysostomos [Wed, 18 Jan 2012 18:57:44 +0000 (10:57 -0800)]
In overload::ov_method, use ‘no overloading’
Using this instead of Scalar::Util makes things marginally faster.
Father Chrysostomos [Wed, 18 Jan 2012 18:44:20 +0000 (10:44 -0800)]
perldelta: another bug number
Father Chrysostomos [Wed, 18 Jan 2012 18:43:44 +0000 (10:43 -0800)]
perldelta for #108480: $cow |= number
Father Chrysostomos [Wed, 18 Jan 2012 06:51:32 +0000 (22:51 -0800)]
[perl #108480] $cow |= number undefines $cow
If a read-only scalar is passed to one of | & ^ and it decides to do
a numeric operation, the numeric flags on the read-only scalar are
turned off afterwards if they were not on to begin with.
This was introduced in commit
b20c4ee1f, which did so to stop $x | "0"
from coercing the rhs and making it behave differently the second
time through.
What that commit did not take into account was that the read-only
flag is set on cow scalars, and the same pp function is used for the
assignment forms. So it was turning off the numeric flags after
$cow |= 1, leaving $cow undef.
I made this numeric flag-twiddling apply only to read-only scalars
(supposedly), because that seemed the most conservative and acceptable
change. I am actually in favour of extending it to all scalars, to
make these operators less surprising. For that reason, this commit
preserves the current behaviour with cows in the non-assignment case:
they don’t get coerced into numbers. Changing them to work the same
way as non-cow writable scalars would make things more consistent, but
more consistently buggy. I would like to make this non-coercion apply
to all scalars in 5.18.
This commit simply skips the flag-twiddling on the lhs in the assign-
ment case.
Father Chrysostomos [Wed, 18 Jan 2012 04:35:24 +0000 (20:35 -0800)]
perldelta for last two fixes
Father Chrysostomos [Wed, 18 Jan 2012 04:33:28 +0000 (20:33 -0800)]
Don’t crash on @a =~ // warning
This is similar to bug #106726, caused by
579333ee9e3 and fixed
by c6fb3f6.
This bug was caused by
c6771ab63d, which had exactly the same mistake.
Attempting to use find_runcv at compile time to find a variable name
is not going to work in general. It only works by accident some
of the time.
Father Chrysostomos [Wed, 18 Jan 2012 02:22:16 +0000 (18:22 -0800)]
[perl #106726] Don’t crash on length(@arr) warning
The RT ticket blames this on
676a678ac, but it was actually commit
579333ee9e3.
676a678ac extended this problem to evals (and modules),
but it already occurred in the main program.
This crashes:
./miniperl -Ilib -we 'sub {length my @forecasts}'
because it is trying to find the variable name for the warning in the
CV returned by find_runcv, but this is a *compile-time* warning, so
using find_runcv is just wrong.
It ends up looking for the array in PL_main_cv’s pad, instead of
PL_compcv.
Tony Cook [Wed, 18 Jan 2012 03:36:12 +0000 (14:36 +1100)]
avoid truncating time values when long is smaller than time_t
long is only 32-bits on x64 Win32, but time_t is 64-bits. This was warning:
POSIX.xs(1777) : warning C4244: 'initializing' : conversion from 'time_t' to 'const long', possible loss of data
The check against (time_t)-1 is the approved check from ANSI C 89 and
99.
Nicholas Clark [Tue, 17 Jan 2012 12:29:56 +0000 (13:29 +0100)]
Avoid 'defined(@array) is deprecated' warnings in tests.
Commit
604a99bd464c92d7 enabled the warning for package arrays, but failed
to lexically disable the warning for the various tests for the construction.
Even though the construction is deprecated, we'd still like to know if the
behaviour changes, in case it wasn't intentional.
Nicholas Clark [Tue, 17 Jan 2012 11:44:42 +0000 (12:44 +0100)]
In Perl_refcounted_he_fetch_pvn(), eliminate nested ? : ternary operators.
Chris 'BinGOs' Williams [Tue, 17 Jan 2012 10:19:13 +0000 (10:19 +0000)]
Update Locale-Maketext to CPAN version 1.22
[DELTA]
2012-01-14
* Minor POD documentation update to sync with upstream blead.
Nicholas Clark [Tue, 10 Jan 2012 14:43:55 +0000 (15:43 +0100)]
Make Pod::Html more robust against malformed L<> contents.
Pod::Html attempts to search for the contents to see if they are a suffix
of any entry in an existing list, using a regular expression.
Previously the contents were interpolated directly into a regex, which
meant that if they happened to be syntactically invalid regular expression
syntax, Pod::Html aborted with a runtime error.
Nicholas Clark [Tue, 10 Jan 2012 13:36:26 +0000 (14:36 +0100)]
Purge references to --netscape and --libpods, no longer in Pod::Html
The long deprecated --netscape flag was removed in commit
27b29ec338b08496.
This was originally added to control use of Netscape specific HTML
extensions, , but became a no-op when that functionality was removed.
--libpods was removed in commit
3b49d8d9ac841d8e.
However neither commit removed use of these flags by callers to Pod::Html,
notably in installhtml and the Makefiles that invoke it. Hence this commit.
Father Chrysostomos [Tue, 17 Jan 2012 07:12:12 +0000 (23:12 -0800)]
perldelta: Typos and calrifications
Father Chrysostomos [Tue, 17 Jan 2012 06:59:42 +0000 (22:59 -0800)]
perldelta up to
1a50d74bac4
Father Chrysostomos [Tue, 17 Jan 2012 04:48:27 +0000 (20:48 -0800)]
perldelta for @& and PL_sawampersand
Father Chrysostomos [Tue, 17 Jan 2012 04:47:46 +0000 (20:47 -0800)]
perldelta for tying and autoviv
Father Chrysostomos [Tue, 17 Jan 2012 04:42:53 +0000 (20:42 -0800)]
perldelta for overload::Overloaded/can change
Father Chrysostomos [Tue, 17 Jan 2012 04:42:35 +0000 (20:42 -0800)]
perldelta for += warning
Father Chrysostomos [Tue, 17 Jan 2012 04:42:11 +0000 (20:42 -0800)]
Lower $overload::VERSION to 1.17
It doesn’t need to be increased twice between releases.
Tony Cook [Mon, 16 Jan 2012 10:11:10 +0000 (21:11 +1100)]
config.over is generated on some platforms, .gitignore it
Tony Cook [Mon, 16 Jan 2012 10:00:00 +0000 (21:00 +1100)]
avoid overflowing a 32-bit signed int
and the associated warning from Solaris C:
"regcomp.c", line 5294: warning: integer overflow detected: op "<<"
Tony Cook [Mon, 16 Jan 2012 22:02:50 +0000 (09:02 +1100)]
handle U suffixed unsigned int literals from regexp.h
Nicholas Clark [Mon, 16 Jan 2012 16:08:38 +0000 (17:08 +0100)]
Provide as much diagnostic information as possible in "panic: ..." messages.
The convention is that when the interpreter dies with an internal error, the
message starts "panic: ". Historically, many panic messages had been terse
fixed strings, which means that the out-of-range values that triggered the
panic are lost. Now we try to report these values, as such panics may not be
repeatable, and the original error message may be the only diagnostic we get
when we try to find the cause.
We can't report diagnostics when the panic message is generated by something
other than croak(), as we don't have *printf-style format strings. Don't
attempt to report values in panics related to *printf buffer overflows, as
attempting to format the values to strings may repeat or compound the
original error.
Father Chrysostomos [Mon, 16 Jan 2012 18:05:41 +0000 (10:05 -0800)]
Increase $Math::BigInt::VERSION to 1.998
Father Chrysostomos [Mon, 16 Jan 2012 18:04:10 +0000 (10:04 -0800)]
BigInt.pm: Suppress overload warning
BigInt.pm intentionally registered an unregisterable op.
Father Chrysostomos [Mon, 16 Jan 2012 17:59:49 +0000 (09:59 -0800)]
perldiag.pod: Document overload’s invalid arg warning
Father Chrysostomos [Mon, 16 Jan 2012 17:59:23 +0000 (09:59 -0800)]
overload.pm: Combine two loops
It should go faster if we only iterate through %arg once.
Father Chrysostomos [Mon, 16 Jan 2012 17:50:47 +0000 (09:50 -0800)]
Test invalid arg warning from overload
Father Chrysostomos [Mon, 16 Jan 2012 17:36:22 +0000 (09:36 -0800)]
overload.pm: Put invalid arg warning in "overload" category
Existing overload warnings work that way.
Father Chrysostomos [Mon, 16 Jan 2012 17:32:09 +0000 (09:32 -0800)]
Suppress ‘useless’ warning in overload.pm
jkeenan [Sun, 15 Jan 2012 14:07:13 +0000 (09:07 -0500)]
Emit a warning if an attempt is made to overload an invalid (e.g., misspelled) operator. For RT #74098.
Nicholas Clark [Wed, 4 Jan 2012 10:36:25 +0000 (11:36 +0100)]
defined(@array) now also warns for package variables.
Nicholas Clark [Wed, 4 Jan 2012 10:23:17 +0000 (11:23 +0100)]
Test that defined warns for package arrays and hashes.
Currently TODO'd for package arrays. The existing tests were only for
lexicals.
Nicholas Clark [Mon, 16 Jan 2012 15:21:21 +0000 (16:21 +0100)]
In Perl_feature_is_enabled() use cBOOL to convert the pointer to a "bool".
On some platforms which don't have a (real) bool type, bool is actually a
char, and hence (sadly) it's correct for the compiler to truncate when
assigning to it, instead of what the programmer thought was going to happen
(testing zero or not). In Perl_feature_is_enabled(), the expression is a
pointer, so if it converts to an integer with the bottom 8 bits zero, then
on these platforms it would truncate to "false". Not what was expected.
Steffen Mueller [Mon, 16 Jan 2012 07:25:09 +0000 (08:25 +0100)]
Shuffle my entry around to use my name instead of old email
Hojung Youn [Mon, 16 Jan 2012 07:19:07 +0000 (08:19 +0100)]
Correct Hojung Youn's name in AUTHORS
Chris 'BinGOs' Williams [Sun, 15 Jan 2012 21:49:01 +0000 (21:49 +0000)]
Bump ExtUtils::Manifest version due to commits
97bae9c5 and
bf081550
Chris 'BinGOs' Williams [Sun, 15 Jan 2012 21:42:59 +0000 (21:42 +0000)]
Bump autouse version due to commit
f965e9d4a
Father Chrysostomos [Sun, 15 Jan 2012 19:36:35 +0000 (11:36 -0800)]
stat.t: Avoid unconditional lstat on file name
lstat on handles is ok.
Father Chrysostomos [Sun, 15 Jan 2012 19:22:34 +0000 (11:22 -0800)]
stat.t, filetest.t: Actually gen rand file names
This mistake of mine was stupid enough I laughed out loud.
Father Chrysostomos [Sun, 15 Jan 2012 06:35:47 +0000 (22:35 -0800)]
perldelta up to
55b5114f4
Hojung Youn [Sun, 15 Jan 2012 03:03:19 +0000 (12:03 +0900)]
[perl #108224] B::Deparse doesn't recognize for continue block
B::Deparse foreach scoping problem was fixed at
cf24a84005,
which was issued at #30504. But B::Deparse was blinded
temporarily by this commit so that it couldn't recognize
foreach continue block for a moment.
foreach statement generates 'nextstate', 'stub', 'leave', or
'scope' root opcode at will when foreach statement is not used
as a oneline statement modifier. So all the case of opcodes
should be checked.
Some tests for foreach scoping and continue block are attached.
related: #30504
Father Chrysostomos [Sun, 15 Jan 2012 06:05:13 +0000 (22:05 -0800)]
perldelta up to
9f71cfe6ef2
Craig A. Berry [Sun, 15 Jan 2012 04:40:24 +0000 (22:40 -0600)]
In vmsify, leave ../ path components alone.
Way back in
08c7cbbb0fc466967038dcb56ca4f1b828b96269, we started
eliminating ../ components when converting paths from Unix syntax
to VMS syntax. No corresponding change was made when converting
in the opposite direction, so this was inconsistent. We should
get a valid path either way, but doing more interpretation than
necessary seems uncalled for, so this patch restores the previous
behavior.
This also paves the way to eliminate some inconsistencies between
what we do when Extended Filename Syntax (EFS) is in effect and
when it's not.
Craig A. Berry [Sat, 14 Jan 2012 22:24:16 +0000 (16:24 -0600)]
Un-TODO some VMS file spec tests under EFS.
When Extended Filename Syntax is enabled, several tests were
expecting not to pass, but they do, so we should say so. Also,
reinstate a test removed in
1fe570cc5e24eecfb07059e53e95fa864bb44142.
Father Chrysostomos [Sat, 14 Jan 2012 21:12:07 +0000 (13:12 -0800)]
Make lstat($ioref) and lstat($gv) consistent
As documented in perldiag, lstat($gv) warns and does an fstat.
lstat($ioref) wasn’t doing what was documented, but after warning
would do the same as stat(_).
Father Chrysostomos [Sat, 14 Jan 2012 20:59:34 +0000 (12:59 -0800)]
stat.t: Make test for -T _ and lstat more robust
It is now less likely to fail if one runs stat.t manually when tests
are running, due to the random file name. It also works now when the
script chdirs (when run outside t), because it no longer relies on $0
being a real file.
That last part was broken by commit
ad2d99e39, which made -T _ more
consistent when it cannot open the file. It used to set the stat
type, but not the success status (as of commit
25988e07, which
fixed #4253).
Craig A. Berry [Sat, 14 Jan 2012 19:16:26 +0000 (13:16 -0600)]
Document the data columns in vms/ext/filespec.t.
Craig A. Berry [Fri, 6 Jan 2012 20:23:59 +0000 (14:23 -0600)]
Stop inadvertently skipping Spec.t on VMS.
ae5a807c7dcf moved a check against $@ away from the eval it was
checking and inserted another eval in between, the effect of which
was to make the tests that can only run on VMS get skipped there
too. Ouch.
There are other problems with
ae5a807c7dcf, but this is a start.
Father Chrysostomos [Sat, 14 Jan 2012 19:31:45 +0000 (11:31 -0800)]
pp_sys.c: goto mustn’t skip initialisation
Father Chrysostomos [Sat, 14 Jan 2012 09:16:58 +0000 (01:16 -0800)]
perldelta up to
7c2b3c783b
Father Chrysostomos [Sat, 14 Jan 2012 09:01:33 +0000 (01:01 -0800)]
magic.t: Correct miniperl skip count
Father Chrysostomos [Sat, 14 Jan 2012 08:23:23 +0000 (00:23 -0800)]
-T "unreadable file" should set stat info consistently
This was mentioned in ticket #77388. It turns out to be
related to #4253.
If the file cannot be opened, -T and -B on filenames set the last han-
dle to null and set the last stat type to stat, but leave the actual
stat buffer and success status as they were.
That means that stat(_) will continue to return the previous buffer,
but lstat(_) will no longer work.
This is another of those inconsistent cases where the internal stat
info is only partially set.
Originally, this code would set PL_laststatval (the success status) to
-1. Commit
25988e07 (the patch in ticket #4253) intentionally changed
this to make -T _ less suprising on read-only files.
But the patch ended up affecting -T with an explicit file name, too.
It also only partially fixed things for -T _, because the last stat
type *was* still being set.
This commit changes it to set all the stat info, for explicit file
names, or no stat info, for _ (if the previous stat was with a
file name).
Father Chrysostomos [Sat, 14 Jan 2012 08:40:05 +0000 (00:40 -0800)]
stat.t: Add bug number
Father Chrysostomos [Sat, 14 Jan 2012 08:33:15 +0000 (00:33 -0800)]
Don’t emit unopened warning for other stat(HANDLE) error
-r or -T on a GV with no IO or on an IO with no fp (or dirp for -r)
will produce an ‘unopened’ warning. stat() on a filehandle will warn
about an unopened filehandle not only if there is no fp, but also if
the fstat call fails (with errno containing EBADP, EFAULT or EIO, at
least on Darwin).
I don’t know if there is a way to test this.
(But pp_stat and my_stat_flags are getting closer, so this must be
correct. :-)
Father Chrysostomos [Sat, 14 Jan 2012 08:07:46 +0000 (00:07 -0800)]
Make -T BADHANDLE set errno with fatal warnings
Due to the order of the statements, SETERRNO would never be reached
with fatal warnings.
I’ve added another SETERRNO out of paranoia. If there is a nicely-
behaved __WARN__ handler, we should still be setting errno just before
-T returns, in case the handler changed it. We can’t do much in
the case of fatal handlers that do system calls. (Is $! localised
for those?)
Father Chrysostomos [Sat, 14 Jan 2012 08:00:26 +0000 (00:00 -0800)]
Make -l HANDLE set PL_laststatval with fatal warnings
Fatal warnings were preventing it from being set, because the warning
came first.
(PL_laststatval records the success status of the previous stat.)
Father Chrysostomos [Sat, 14 Jan 2012 07:50:15 +0000 (23:50 -0800)]
Make -T HANDLE and -B HANDLE always set last stat type
-T and -B on handles always set PL_laststatval (which indicates the
success of the previous stat). But they don’t set the last stat type
(PL_laststype) for closed filehandles. Those two should always go
together. stat and -r, -w etc., always set PL_laststype for a closed
or missing filehandle.