This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
5 months agoop.h: Restrict scope of multiconcat symbols to core
Karl Williamson [Sat, 17 Oct 2020 15:20:52 +0000 (09:20 -0600)]
op.h: Restrict scope of multiconcat symbols to core

These are internal only

5 months agoperlop: Enhance a tr/// example
Karl Williamson [Sat, 7 Nov 2020 18:11:09 +0000 (11:11 -0700)]
perlop: Enhance a tr/// example

This more clearly demonstrates that the /s option squeezes based on
the result rather than the source

5 months agopod/perlfunc.pod: Correct one typo
James E Keenan [Fri, 13 Nov 2020 12:25:24 +0000 (07:25 -0500)]
pod/perlfunc.pod: Correct one typo

For: https://github.com/Perl/perl5/issues/18315; thanks to valtkus.

5 months agoUpdate ExtUtils-MakeMaker to CPAN version 7.54
Chris 'BinGOs' Williams [Thu, 12 Nov 2020 19:55:04 +0000 (19:55 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.54

  [DELTA]

7.54    Thu 12 Nov 19:23:18 GMT 2020

    No changes since v7.53_01

7.53_01 Tue 10 Nov 03:34:42 GMT 2020

    Regression fixes:
    - Fixed Darwin cflags override

    Meta fixes:
    - Updated URLs to use https

5 months agofetch magic on the first stacked filetest, not the last
Tony Cook [Tue, 10 Nov 2020 04:50:27 +0000 (15:50 +1100)]
fetch magic on the first stacked filetest, not the last

fixes #18293

5 months agoDocument PERL_SI
Karl Williamson [Sat, 17 Oct 2020 18:51:44 +0000 (12:51 -0600)]
Document PERL_SI

5 months agoDocument TARG, dTARGET
Karl Williamson [Sat, 29 Aug 2020 17:00:28 +0000 (11:00 -0600)]
Document TARG, dTARGET

5 months agoperlapi: Document Perlacos and similar
Karl Williamson [Mon, 2 Nov 2020 04:40:54 +0000 (21:40 -0700)]
perlapi: Document Perlacos and similar

5 months agoFix defns of e.g. U8_MAX/MIN
Karl Williamson [Sat, 7 Nov 2020 22:18:09 +0000 (15:18 -0700)]
Fix defns of e.g. U8_MAX/MIN

Actually trying to compile these with Devel::PPPort revealed that there
were combinations of the conditionals which led to some of the symbols
not getting defined.

5 months agoperlapi: Consolidate sv_setpv-ish entries
Karl Williamson [Sun, 6 Sep 2020 03:20:30 +0000 (21:20 -0600)]
perlapi: Consolidate sv_setpv-ish entries

5 months agoperlapi: Consolidate sv_setpvn-ish entries
Karl Williamson [Sun, 6 Sep 2020 03:19:30 +0000 (21:19 -0600)]
perlapi: Consolidate sv_setpvn-ish entries

5 months agoAdd a few helpers to B for INVLIST
Nicolas R [Tue, 3 Nov 2020 22:28:04 +0000 (15:28 -0700)]
Add a few helpers to B for INVLIST

This commit provide some basic method
to access to internal fields from one
INVLIST: SVt_INVLIST

- prev_index
- is_offset
- array_len
- get_invlist_array

This allows B::C to be walk and save invlists.

5 months agot/op/inc.t, t/op/hexfp.t, t/op/sprintf2.t: Add missing d_ prefixes for Config variabl...
TAKAI Kousuke [Thu, 5 Nov 2020 13:06:16 +0000 (22:06 +0900)]
t/op/inc.t, t/op/hexfp.t, t/op/sprintf2.t: Add missing d_ prefixes for Config variable names.

5 months agoperlapi: Consolidate sv_setsv-ish entries
Karl Williamson [Sun, 6 Sep 2020 03:18:19 +0000 (21:18 -0600)]
perlapi: Consolidate sv_setsv-ish entries

5 months agosv.c: Change some formal param names for clarity, consistency
Karl Williamson [Thu, 8 Oct 2020 20:36:33 +0000 (14:36 -0600)]
sv.c: Change some formal param names for clarity, consistency

The names previously indicated some things were strings that weren't
necessarily so.  Some nearly identical functions had varying parameter
names.

5 months agosv.c: Rmv trailing blanks
Karl Williamson [Thu, 8 Oct 2020 20:37:51 +0000 (14:37 -0600)]
sv.c: Rmv trailing blanks

This will make later commits easier to do.

5 months agoutf8.c: Note various symbols are documented here
Karl Williamson [Sat, 17 Oct 2020 13:43:31 +0000 (07:43 -0600)]
utf8.c: Note various symbols are documented here

5 months agoUpdate perlfaq to CPAN version 5.20200523
Karen Etheridge [Sat, 7 Nov 2020 21:04:53 +0000 (13:04 -0800)]
Update perlfaq to CPAN version 5.20200523

  [DELTA]

5.20201107  2020-11-07 21:02:39Z
  * typo fix (PR#90, Samanta Navarro)
  * fix learn.perl.org link, which now directs to perldoc.perl.org (PR#91, Dan
    Book)
  * modern updates to "How do I efficiently match many regular expressions"
    (PR#92, Dan Book)

5 months agoperlapi/perlintern: Better sort the SEE ALSO scn
Karl Williamson [Sat, 7 Nov 2020 15:00:30 +0000 (08:00 -0700)]
perlapi/perlintern: Better sort the SEE ALSO scn

5 months agoperl.h: Fix misplaced #ifdef
Karl Williamson [Fri, 6 Nov 2020 16:00:44 +0000 (09:00 -0700)]
perl.h: Fix misplaced #ifdef

This fixes GH #18295

The #ifdef introduced in 6bcc290 was meant to go after the line that it
actually did

5 months agoFix unitialized warnings in S_pmtrans
Nicolas R [Thu, 5 Nov 2020 16:30:34 +0000 (10:30 -0600)]
Fix unitialized warnings in S_pmtrans

5 months agoperlapi: PL_runops is documented in perlguts
Karl Williamson [Fri, 6 Nov 2020 01:04:06 +0000 (18:04 -0700)]
perlapi: PL_runops is documented in perlguts

5 months agoperlapi: Split section Display and Dump
Karl Williamson [Fri, 6 Nov 2020 00:39:40 +0000 (17:39 -0700)]
perlapi: Split section Display and Dump

into Debugging and Display sections

5 months agoautodoc.pl: A hash needs to have no keys to be empty
Karl Williamson [Fri, 6 Nov 2020 15:21:32 +0000 (08:21 -0700)]
autodoc.pl: A hash needs to have no keys to be empty

5 months agoautodoc.pl: Specify scn for single-purpose files
Karl Williamson [Wed, 4 Nov 2020 16:37:34 +0000 (09:37 -0700)]
autodoc.pl: Specify scn for single-purpose files

Many of the files in perl are for one thing only, and hence their
embedded documentation will be for that one thing.  By creating a hash
here of them, those files don't have to worry about what section that
documentation goes under, and so it can be completely changed without
affecting them.

5 months agoRevert and fix "autodoc.pl: Don't recalculate value"
Karl Williamson [Fri, 6 Nov 2020 14:12:28 +0000 (07:12 -0700)]
Revert and fix "autodoc.pl: Don't recalculate value"

This reverts commit 0213d97dcda976f02ce257031d969e7964ecc545, and fixes
it up.

That commit failed to account for that there were extra components
needed in the calculation

5 months agoperlapi: PERL_ABS takes an argument
Karl Williamson [Fri, 6 Nov 2020 01:20:20 +0000 (18:20 -0700)]
perlapi: PERL_ABS takes an argument

5 months agoautodoc.pl: Enhance apidoc_section feature
Karl Williamson [Wed, 4 Nov 2020 13:13:30 +0000 (06:13 -0700)]
autodoc.pl: Enhance apidoc_section feature

This feature allows documentation destined for perlapi or perlintern to
be split into sections of related functions, no matter where the
documentation source is.  Prior to this commit the line had to contain
the exact text of the title of the section.  Now it can be a $variable
name that autodoc.pl expands to the title. It still has to be an exact
match for the variable in autodoc, but now, the expanded text can be
changed in autodoc alone, without other files needing to be updated at
the same time.

5 months agoperlapi: Add a link at the beginning to the Undocumenteds
Karl Williamson [Wed, 4 Nov 2020 15:48:51 +0000 (08:48 -0700)]
perlapi: Add a link at the beginning to the Undocumenteds

5 months agoautodoc.pl: Rename a few variables for consistency
Karl Williamson [Wed, 4 Nov 2020 14:54:55 +0000 (07:54 -0700)]
autodoc.pl: Rename a few variables for consistency

5 months agoautodoc.pl: Extract code into a fcn
Karl Williamson [Wed, 4 Nov 2020 11:51:39 +0000 (04:51 -0700)]
autodoc.pl: Extract code into a fcn

This is in preparation for it to be called from a 2nd place

5 months agoautodoc.pl: Don't recalculate value
Karl Williamson [Wed, 4 Nov 2020 11:46:18 +0000 (04:46 -0700)]
autodoc.pl: Don't recalculate value

e4f5ddf407394c177acefd200a338654dccca2e4 moved this calculation, but I
forgot to remove this portion of it.

5 months agoautodoc.pl: White-space, comments only
Karl Williamson [Wed, 4 Nov 2020 11:40:53 +0000 (04:40 -0700)]
autodoc.pl: White-space, comments only

5 months agoperlguts: SAVEBOOL takes a bool
Karl Williamson [Fri, 6 Nov 2020 03:39:26 +0000 (20:39 -0700)]
perlguts: SAVEBOOL takes a bool

5 months agoperlinterp: Fix markup
Karl Williamson [Fri, 6 Nov 2020 01:31:24 +0000 (18:31 -0700)]
perlinterp: Fix markup

FOO is allegoric, not literal

5 months agoperlapi: Move some formats to the Formatting scn
Karl Williamson [Wed, 4 Nov 2020 11:33:15 +0000 (04:33 -0700)]
perlapi: Move some formats to the Formatting scn

These were going into wrong ones.

5 months agoFile::Path: synch with CPAN version 2.18
James E Keenan [Thu, 5 Nov 2020 19:47:37 +0000 (14:47 -0500)]
File::Path: synch with CPAN version 2.18

No change in functionality; change in tests only.

5 months agodragonfly BSD sets errno incorrectly for terminal control functions
Tony Cook [Tue, 27 Oct 2020 15:36:46 +0000 (15:36 +0000)]
dragonfly BSD sets errno incorrectly for terminal control functions

5 months agodragonfly doesn't touch ctime as documented, at least on hammer2
Tony Cook [Mon, 26 Oct 2020 16:51:52 +0000 (16:51 +0000)]
dragonfly doesn't touch ctime as documented, at least on hammer2

This is a TODO so we find out if it's fixed

5 months agodocument the issues for the enoent problem on dragonfly
Tony Cook [Mon, 26 Oct 2020 16:50:44 +0000 (16:50 +0000)]
document the issues for the enoent problem on dragonfly

5 months agodragonfly bsd timestamps are only microsecond precision
Tony Cook [Mon, 26 Oct 2020 16:44:59 +0000 (16:44 +0000)]
dragonfly bsd timestamps are only microsecond precision

based on testing

5 months agodragonfly BSD's default filesystem is mounted noatime by default
Tony Cook [Mon, 26 Oct 2020 16:44:14 +0000 (16:44 +0000)]
dragonfly BSD's default filesystem is mounted noatime by default

5 months agoCatch errors earlier in Devel-Peek/t/Peek.t
Nicolas R [Thu, 27 Aug 2020 17:40:51 +0000 (12:40 -0500)]
Catch errors earlier in Devel-Peek/t/Peek.t

When testing Devel-Peek we can run some tests
inside an eval and do not bother to check if it
succeeds or not.

As STDERR is redirected to a file, we do not even
notice the error message when an error occurs.

This commit postpones the redirection of STDERR
and 'die' if the eval quoted string from `do_test` fails.

5 months agoUpdate ExtUtils-MakeMaker to CPAN version 7.52
Chris 'BinGOs' Williams [Wed, 4 Nov 2020 20:34:01 +0000 (20:34 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.52

  [DELTA]

7.52    Wed  4 Nov 19:49:43 GMT 2020

    No changes since v7.51_01

7.51_01 Wed  4 Nov 00:01:41 GMT 2020

    Test fixes:
    - prevent MM_Win32::init_tools() warning in core

7.50    Wed 21 Oct 17:33:53 BST 2020

    No changes since v7.49_04

7.49_04 Tue 13 Oct 18:42:05 BST 2020

    Win32 fixes:
    - make can_dep_space check for short path support

    Macosx fixes:
    - Handle XCode 12's implicit adding of Werror=implicit-function-declaration

7.49_03 Fri  9 Oct 21:30:57 BST 2020

    Regression fixes:
    - disable strict when evaling hints files

    Bug fixes:
    - clean up and improve MIN_PERL_VERSION handling

7.49_02 Thu  8 Oct 08:35:05 BST 2020

    Bug fixes:
    - Change wording of MIN_PERL_VERSION format message to clarify
      fatally

    Doc fixes:
    - Fixed some typos

7.49_01 Tue  6 Oct 18:01:38 BST 2020

    Regression fixes:
    - fix PERL_CORE warnings from ExtUtils::CBuilder

5 months ago\K in lookaround might become permitted in the future
Tony Cook [Mon, 19 Oct 2020 04:57:37 +0000 (15:57 +1100)]
\K in lookaround might become permitted in the future

It was disallowed because:

- it was breaking things (GH #14638)

- at the time, no-one had the tuits and knowledge to select non-buggy
  semantics and implement them.

5 months agosome extra tests as suggested by hvds
Tony Cook [Mon, 19 Oct 2020 04:04:28 +0000 (15:04 +1100)]
some extra tests as suggested by hvds

5 months agodon't croak when the \K follows the lookaround assertion
Tony Cook [Mon, 14 Sep 2020 06:00:28 +0000 (16:00 +1000)]
don't croak when the \K follows the lookaround assertion

this also simplifies the flagging for these assertions, since this
error is now the only thing using in_lookhead and in_lookbehind they
can be combined into a single in_lookaround.

Rather than conditional increment/decrement as we recurse into S_reg
I simply save the value of in_lookaround and restore it before
returning.  Some unsuccessful or restart paths don't do the restore,
but they either result in a croak(), or a restart which reinitialises
in_lookaround anyway.

Also added tests to ensure that all the different zero-width assertions
with content trigger the error.

5 months agorun_multiple_progs: allow the EXPECT to contain only OPTIONS
Tony Cook [Mon, 14 Sep 2020 05:51:05 +0000 (15:51 +1000)]
run_multiple_progs: allow the EXPECT to contain only OPTIONS

5 months agorun_multiple_progs: allow fatal to be turned off too
Tony Cook [Mon, 14 Sep 2020 05:49:40 +0000 (15:49 +1000)]
run_multiple_progs: allow fatal to be turned off too

in some cases we want to group a test that shouldn't croak with the
croak tests, in particular to catch regressions when we've
introduced a croak.

5 months agoBump the version
Scott Baker [Tue, 11 Aug 2020 16:24:18 +0000 (09:24 -0700)]
Bump the version

5 months agoFix a failing test
Scott Baker [Tue, 11 Aug 2020 16:24:13 +0000 (09:24 -0700)]
Fix a failing test

5 months agoFix some tests for Pod2HTML
Scott Baker [Tue, 11 Aug 2020 15:01:41 +0000 (08:01 -0700)]
Fix some tests for Pod2HTML

5 months agoLeave tabstops at 8
Scott Baker [Mon, 3 Aug 2020 23:34:40 +0000 (16:34 -0700)]
Leave tabstops at 8

5 months agoUse Text::Tabs to convert tabs to spaces instead
Scott Baker [Mon, 3 Aug 2020 23:39:00 +0000 (16:39 -0700)]
Use Text::Tabs to convert tabs to spaces instead

5 months agoChange wording on source of code
Scott Baker [Mon, 3 Aug 2020 21:25:00 +0000 (14:25 -0700)]
Change wording on source of code

5 months agoMake pod2html remove whitespace from literal blocks
Scott Baker [Mon, 3 Aug 2020 20:08:33 +0000 (13:08 -0700)]
Make pod2html remove whitespace from literal blocks

This brings pod2html functionality similar to how Metacpan handles
whitespace

5 months agoav_make: remove unnecessary AvFILLp assignment
Richard Leach [Mon, 2 Nov 2020 22:52:19 +0000 (22:52 +0000)]
av_make: remove unnecessary AvFILLp assignment

av_make sets `AvFILLp(av)= -1;`, but will already have been set by `newAV()`,
via `newSV_type`'s call to `sv_upgrade`.

This PR also includes the minor cosmetic change of swapping in `newAV()`
in place of its expansion, seemingly the only occurrence of that in core.

5 months agoext/POSIX/t/sysconf.t: only unlink the fifo if we have a name for it
Tony Cook [Tue, 3 Nov 2020 22:21:37 +0000 (09:21 +1100)]
ext/POSIX/t/sysconf.t: only unlink the fifo if we have a name for it

This warned on Win32 since the whole test file is skipped due
to the lack of anything sysconf() to test.

5 months agoext/POSIX/t/posix.t: 0ee0b3d1 added 'use warnings', fix the warnings
Tony Cook [Tue, 3 Nov 2020 22:10:43 +0000 (09:10 +1100)]
ext/POSIX/t/posix.t: 0ee0b3d1 added 'use warnings', fix the warnings

locales_enabled() accepts either an optional category name, or an
arrayref of category names, and is prototyped to accept a scalar, so
the qw() was evaluated in scalar context, ignoring the "NUMERIC" and
producing a warning.

The POSIX::pipe() test is testing the POSIX::pipe() function, not
globs, so just use lexical handles.

These warnings came up while cleaning up noise in the Win32 build, but
the warnings occur on Linux too.

Useless use of a constant ("NUMERIC") in void context at t/posix.t line 358.
Name "main::WRITER" used only once: possible typo at t/posix.t line 78.
Name "main::READER" used only once: possible typo at t/posix.t line 77.

5 months agorun/locale.t: don't setlocale() for our English locale if there isn't one
Tony Cook [Tue, 3 Nov 2020 04:37:33 +0000 (15:37 +1100)]
run/locale.t: don't setlocale() for our English locale if there isn't one

This was producing noise on Win32 builds:

Use of uninitialized value in subroutine entry at run/locale.t line 519.

5 months agoadd versions to POSIX features
Dan Book [Fri, 11 Aug 2017 19:37:14 +0000 (15:37 -0400)]
add versions to POSIX features

5 months agoperldata - example of using DATA
Dan Book [Tue, 3 Nov 2020 06:54:22 +0000 (01:54 -0500)]
perldata - example of using DATA

5 months agoallow watchdog() to work in taint mode on non-threaded Win32
Tony Cook [Tue, 3 Nov 2020 04:11:30 +0000 (15:11 +1100)]
allow watchdog() to work in taint mode on non-threaded Win32

This was producing noise:

Insecure $ENV{PATH} while running with -T switch at ./test.pl line 1673.

from perf/taint.t and re/substT.t

5 months agoNote various symbols are documented in perlinterp
Karl Williamson [Sat, 17 Oct 2020 17:28:56 +0000 (11:28 -0600)]
Note various symbols are documented in perlinterp

5 months agoCertain PERL_UNICODE symbols are core only
Karl Williamson [Sat, 17 Oct 2020 21:58:01 +0000 (15:58 -0600)]
Certain PERL_UNICODE symbols are core only

5 months agoNote MRO_GET_PRIVATE_DATA is documented in perlmroapi
Karl Williamson [Sat, 17 Oct 2020 17:30:29 +0000 (11:30 -0600)]
Note MRO_GET_PRIVATE_DATA is documented in perlmroapi

5 months agoNote various symbols are documented in perliol
Karl Williamson [Sat, 17 Oct 2020 17:29:40 +0000 (11:29 -0600)]
Note various symbols are documented in perliol

5 months agodon't read DATA when it is closed
Tony Cook [Tue, 3 Nov 2020 03:03:32 +0000 (14:03 +1100)]
don't read DATA when it is closed

This has been producing noise for a while, but some recent change
meant it started some warning tests failing.

5 months agoexport delimcpy_no_escape() so XS::APItest can use it
Tony Cook [Mon, 2 Nov 2020 23:23:34 +0000 (10:23 +1100)]
export delimcpy_no_escape() so XS::APItest can use it

5 months agoperlapi: Fix signature for PadnameOURSTASH
Karl Williamson [Sat, 17 Oct 2020 15:22:23 +0000 (09:22 -0600)]
perlapi: Fix signature for PadnameOURSTASH

This takes a parameter

5 months agoregcomp.h: Restrict scope of symbols to core
Karl Williamson [Sat, 17 Oct 2020 15:12:59 +0000 (09:12 -0600)]
regcomp.h: Restrict scope of symbols to core

Everything defined here are internal symbols

5 months agouni_keywords.h: Confine the scope to core
Karl Williamson [Sat, 17 Oct 2020 13:36:32 +0000 (07:36 -0600)]
uni_keywords.h: Confine the scope to core

All symbols in here are for core only use

5 months agoConfine regnodes.h symbols to core
Karl Williamson [Sat, 17 Oct 2020 13:23:40 +0000 (07:23 -0600)]
Confine regnodes.h symbols to core

This is to not pollute XS namespace, and to not autodoc them.

5 months agoperlapi: WIDEST_UTYPE is a typedef
Karl Williamson [Sat, 17 Oct 2020 12:51:04 +0000 (06:51 -0600)]
perlapi: WIDEST_UTYPE is a typedef

5 months agoperlapi: StructCopy isn't conventional
Karl Williamson [Sat, 17 Oct 2020 12:49:24 +0000 (06:49 -0600)]
perlapi: StructCopy isn't conventional

so suppress the usage line.

5 months agohv_func.h, hv_macro.h: Rename compile-once guard
Karl Williamson [Sat, 17 Oct 2020 12:47:11 +0000 (06:47 -0600)]
hv_func.h, hv_macro.h: Rename compile-once guard

These #defines are internal-only, so mark them as such by adding a
trailing underscore to their names.

5 months agoCast parameters to instr, strstr
Karl Williamson [Sat, 17 Oct 2020 12:00:22 +0000 (06:00 -0600)]
Cast parameters to instr, strstr

This code isn't apparently compiled on modern platforms, as when I tried
to force them to compile, I had to do this.

5 months agointrpvar.h: Don't define an undef symbol
Karl Williamson [Mon, 2 Nov 2020 04:02:03 +0000 (21:02 -0700)]
intrpvar.h: Don't define an undef symbol

This symbol needs MULTIPLICTY for its target to actually be defined.
Discovered by Devel::PPPort

5 months agoXSUB.h: Fix some apidoc entries
Karl Williamson [Mon, 2 Nov 2020 03:58:42 +0000 (20:58 -0700)]
XSUB.h: Fix some apidoc entries

So that Devel::PPPort can test that they compile

5 months agoperlapi: Add a link to xsubpp
Karl Williamson [Mon, 2 Nov 2020 03:57:55 +0000 (20:57 -0700)]
perlapi: Add a link to xsubpp

5 months agoperlguts: Fix up some perlapi entries
Karl Williamson [Mon, 2 Nov 2020 03:32:56 +0000 (20:32 -0700)]
perlguts: Fix up some perlapi entries

There were syntax errors in these.

5 months agoperlapi: Document IV_MAX, UV_MAX
Karl Williamson [Sat, 17 Oct 2020 21:37:18 +0000 (15:37 -0600)]
perlapi: Document IV_MAX, UV_MAX

5 months agoperlclib: Don't mention toFOO_LC()
Karl Williamson [Sat, 31 Oct 2020 18:32:41 +0000 (12:32 -0600)]
perlclib: Don't mention toFOO_LC()

There are locales where these macros don't give the right answer for all
legal inputs; so don't mention them.

5 months agoperlio.c: White-space, dead-code only
Karl Williamson [Sat, 31 Oct 2020 18:29:08 +0000 (12:29 -0600)]
perlio.c: White-space, dead-code only

This properly indents nested #preprocessor directives, and removes two
empty #if's

5 months agoBen Cornett is now a Perl author
James E Keenan [Sun, 1 Nov 2020 02:35:52 +0000 (22:35 -0400)]
Ben Cornett is now a Perl author

5 months agoFix typo in perlguts 18277/head
Ben Cornett [Sun, 1 Nov 2020 02:20:05 +0000 (22:20 -0400)]
Fix typo in perlguts

5 months agoperlapi: Document SvPV_free
Karl Williamson [Thu, 8 Oct 2020 20:14:46 +0000 (14:14 -0600)]
perlapi: Document SvPV_free

5 months agoFix up delimcpy_no_escape()
Karl Williamson [Sat, 17 Oct 2020 03:08:13 +0000 (21:08 -0600)]
Fix up delimcpy_no_escape()

I modified this function in ab01742544b98b5b5e13d8e1a6e9df474b9e3005,
and did not fully understand the edge cases.  This commit now handles
those properly, the same as plain delimcpy() does.

5 months agoRewrite delimcpy to use memchr and Copy, not per-byte
Karl Williamson [Fri, 16 Oct 2020 19:27:55 +0000 (13:27 -0600)]
Rewrite delimcpy to use memchr and Copy, not per-byte

Prior to this commit delimcpy() parsed its input byte-by-byte, looking
for a particular character, and copied the input to the output stopping
just before the first such occurrence.

memchr() is much faster for finding a single character.

The complication is that if the character is preceded by a backslash,
it doesn't count as that character, it is considered to be escaped, and
parsing continues to the first unescaped occurrence, if any. Each
escaping backslash is not copied.

The prior code also failed to account for the possibility of the delimiter
being a backslash, the same as the escape.

The new routine looks for the character with memchr, sees if it is
escaped. If not, Copy does the whole copy at once. If it is escaped,
it uses Copy up to that backslash, and repeats the process.

5 months agoAdd API test for delimcpy()
Karl Williamson [Sun, 16 Aug 2020 12:50:12 +0000 (06:50 -0600)]
Add API test for delimcpy()

It turns out that the existing implementation has some bugs, so some of
the tests are marked TODO.

5 months agoPerl_custom_op_get_field(): remove undef behaviour
David Mitchell [Fri, 30 Oct 2020 20:50:58 +0000 (20:50 +0000)]
Perl_custom_op_get_field(): remove undef behaviour

Thus function has a couple a switches with

               default:
                   NOT_REACHED; /* NOTREACHED */

but clang is complaining that the value returned by the function is
undefined if those default branches are taken, since the 'any' variable
doesn't get set in that path.

Replace the NOTREACHED with a croak("panic: ..."). It's possible (albeit
not intended) for Perl_custom_op_get_field() to be called with a 'field'
arg which triggers the default case. So if this ever happens, make it
clear that something has gone wrong, rather than just silently
continuing on non-debugging builds.

In any case, this shuts up clang.

5 months agoPathTools/Cwd.xs: fix off-by-one in bsd_realpath()
David Mitchell [Mon, 26 Oct 2020 15:11:14 +0000 (15:11 +0000)]
PathTools/Cwd.xs: fix off-by-one in bsd_realpath()

At the heart of this function is a loop which repeatedly finds the next
component in the path, processes it, then chops that component off the
front of the path by shifting the string to the start of the buffer;
i.e. something like:

    while (remaining_len) {
        s = strchr(remaining, '/')
        ...
        remaining_len -= s - remaining;
        memmove(remaining, s, remaining_len + 1);
    }

The problem is that the per-iteration decrement to remaining_len doesn't
take account of the '/' character, so each iteration, remaining_len gets
one more byte too big.

It turns out that this is harmless - it just means that more and more
garbage characters after the trailing null byte get copied each time,
but after each copy the path string is still well formed, with a
trailing null in the right place. So just the random garbage after the
null byte is different.

This commit fixes that.

Although really, it would be better to just increment the
start-of-string pointer each time rather than shift the whole string
each time.

5 months agobump version numbers for PathTools to 3.79
David Mitchell [Mon, 26 Oct 2020 15:13:29 +0000 (15:13 +0000)]
bump version numbers for PathTools to 3.79

5 months agoext/POSIX/t/posix.t: use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 20:18:19 +0000 (14:18 -0600)]
ext/POSIX/t/posix.t: use 'warnings'

5 months agot/run/locale.t: use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 20:16:51 +0000 (14:16 -0600)]
t/run/locale.t: use 'warnings'

A symobl it was testing is either defined or not; was testing the wrong
thing

5 months agoloc_tools.pl: use 'warnings'
Karl Williamson [Thu, 29 Oct 2020 22:09:15 +0000 (16:09 -0600)]
loc_tools.pl: use 'warnings'

5 months agoloc_tools.pl: Fix locales_enabled()
Karl Williamson [Thu, 29 Oct 2020 21:53:50 +0000 (15:53 -0600)]
loc_tools.pl: Fix locales_enabled()

This commit properly returns the new list it is supposed to, clarifies
the documentation.

Fixes GH #18245

5 months agot/loc_tools.pl: Don't destroy caller's array
Karl Williamson [Thu, 29 Oct 2020 20:30:46 +0000 (14:30 -0600)]
t/loc_tools.pl: Don't destroy caller's array

This changes to make a copy of the input array, which can then be
modified without affecting the caller.

5 months agoremove assertion that collation magic has data
Tony Cook [Thu, 29 Oct 2020 04:59:16 +0000 (15:59 +1100)]
remove assertion that collation magic has data

This broke on some smokers where the locale collation data was
broken in some way (and rejected by the collation setup code.)

It also broke if collation magic was generated for an SV and then
the SV was modified, freeing the collation data before the SV was
destroyed.

5 months agoremove dead code when using Perl_strtod for numeric conversion
Tony Cook [Wed, 21 Oct 2020 00:02:20 +0000 (11:02 +1100)]
remove dead code when using Perl_strtod for numeric conversion

which is the common case.

If strtod() is disabled, (and USE_PERL_ATOF isn't also disabled) this
code is used, so I moved it into the #elif block.

It's also possible to Configure disabling both strtod() and
USE_PERL_ATOF with:

  ./Configure ... -Ud_strtod -Accflags=-DUSE_PERL_ATOF=0 ...

which resulted in a build with a broken Perl_my_atof3(), so fail the
build early with #error in that case.