[perl.git] branch blead updated. v5.27.7-149-g6661956a23

2018-01-15 Thread Zefram
In perl.git, the branch blead has been updated



- Log -
commit 6661956a23de82b41adc406200054293d6d7aded
Author: Zefram 
Date:   Tue Jan 16 06:22:17 2018 +

vivify array elements when putting them on stack

When the elements of an array are put on the stack, by a padav, rv2av,
or padrange op, null pointers in the AvARRAY were being pushed as
&PL_sv_undef, which was OK in rvalue contexts but caused misbehaviour
in lvalue contexts.  Change this to vivify these elements.  There's no
attempt here to limit the vivification to lvalue contexts: the existing
op flags aren't enough to detect \(@a), and attempting to catch all
cases where a new flag needs to be set would be an error-prone process.
Fixes [perl #8910].

---

Summary of changes:
 pp_hot.c |  8 +---
 t/op/array.t | 18 +-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/pp_hot.c b/pp_hot.c
index 8a74f58cb8..d479ecf218 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1163,15 +1163,17 @@ S_pushav(pTHX_ AV* const av)
 if (UNLIKELY(SvRMAGICAL(av))) {
 PADOFFSET i;
 for (i=0; i < (PADOFFSET)maxarg; i++) {
-SV ** const svp = av_fetch(av, i, FALSE);
+SV ** const svp = av_fetch(av, i, TRUE);
 SP[i+1] = svp ? *svp : &PL_sv_undef;
 }
 }
 else {
 PADOFFSET i;
 for (i=0; i < (PADOFFSET)maxarg; i++) {
-SV * const sv = AvARRAY(av)[i];
-SP[i+1] = LIKELY(sv) ? sv : &PL_sv_undef;
+SV *sv = AvARRAY(av)[i];
+   if (!LIKELY(sv))
+   AvARRAY(av)[i] = sv = newSV(0);
+   SP[i+1] = sv;
 }
 }
 SP += maxarg;
diff --git a/t/op/array.t b/t/op/array.t
index 59ba434264..4d16272459 100644
--- a/t/op/array.t
+++ b/t/op/array.t
@@ -6,7 +6,7 @@ BEGIN {
 set_up_inc('.', '../lib');
 }
 
-plan (173);
+plan (178);
 
 #
 # @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -575,4 +575,20 @@ $#a = -1; $#a++;
 $#a = -1; $#a++;
 () = 0+splice @a, 0, 1, 1, 1;
 
+# [perl #8910] lazy creation of array elements used to leak out
+{
+sub t8910 { $_[1] = 5; $_[2] = 7; }
+my @p;
+$p[0] = 1;
+$p[2] = 2;
+t8910(@p);
+is "@p", "1 5 7", "lazy element creation with sub call";
+my @q;
+@q[0] = 1;
+@q[2] = 2;
+my @qr = \(@q);
+is $qr[$_], \$q[$_], "lazy element creation with refgen" foreach 0..2;
+isnt $qr[1], \undef, "lazy element creation with refgen";
+}
+
 "We're included by lib/Tie/Array/std.t so we need to return something true";

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-148-ga97021b9d2

2018-01-15 Thread Zefram
In perl.git, the branch blead has been updated



- Log -
commit a97021b9d2cff6f0f8cbe5a5dd51187c5bad275e
Author: Zefram 
Date:   Tue Jan 16 05:16:41 2018 +

correct error returns from fast_abs_path()

fast_abs_path() is documented as behaving like abs_path(), and is even
used as the main version of abs_path() on Cygwin, so it should indicate
errors in the same manner.  It was croaking; change this to return undef
with $! set.  Leave croaking for the error that breaks the abs_path()
rules, where fast_abs_path() has changed cwd and fails to change back.
Problem noted on [perl #132648].

---

Summary of changes:
 dist/PathTools/Cwd.pm | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index c648a57c1e..451c69d3d1 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -462,6 +462,7 @@ my $Curdir;
 sub fast_abs_path {
 local $ENV{PWD} = $ENV{PWD} || ''; # Guard against clobberage
 my $cwd = getcwd();
+defined $cwd or return undef;
 require File::Spec;
 my $path = @_ ? shift : ($Curdir ||= File::Spec->curdir);
 
@@ -471,7 +472,9 @@ sub fast_abs_path {
 ($cwd)  = $cwd  =~ /(.*)/s;
 
 unless (-e $path) {
-   _croak("$path: No such file or directory");
+   require Errno;
+   $! = Errno::ENOENT();
+   return undef;
 }
 
 unless (-d _) {
@@ -482,7 +485,7 @@ sub fast_abs_path {
 
if (-l $path) {
my $link_target = readlink($path);
-   die "Can't resolve link $path: $!" unless defined $link_target;
+   defined $link_target or return undef;

$link_target = File::Spec->catpath($vol, $dir, $link_target)
 unless File::Spec->file_name_is_absolute($link_target);
@@ -496,7 +499,7 @@ sub fast_abs_path {
 }
 
 if (!CORE::chdir($path)) {
-   _croak("Cannot chdir to $path: $!");
+   return undef;
 }
 my $realpath = getcwd();
 if (! ((-d $cwd) && (CORE::chdir($cwd {

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-147-g4d8d7a4152

2018-01-15 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
---

Summary of changes:
 hints/freebsd.sh | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 5d69dee0eb..07eab0e252 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -343,3 +343,10 @@ case "$cc" in
   ;;
 esac
 
+case `uname -p` in
+arm|mips)
+  ;;
+*)
+  test "$optimize" || optimize='-O2'
+  ;;
+esac

-- 
Perl5 Master Repository


[perl.git] branch tonyc/132704-freebsd-optimize created. v5.27.7-147-g4d8d7a4152

2018-01-15 Thread Tony Cook
In perl.git, the branch tonyc/132704-freebsd-optimize has been created



at  4d8d7a4152178168855cb6a4506025a5d82465c7 (commit)

- Log -
commit 4d8d7a4152178168855cb6a4506025a5d82465c7
Author: Tom Hukins 
Date:   Wed Jan 10 18:53:24 2018 +

Set more sensible -O optimization on FreeBSD

FreeBSD's /usr/share/mk/sys.mk specifies -O2 for architectures other
than arm and mips.  By default, compile perl with the same optimization
levels.

---

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/tonyc/127743-cperl-storable-fixes updated. v5.27.7-200-ge4b11f15c4

2018-01-15 Thread Tony Cook
In perl.git, the branch smoke-me/tonyc/127743-cperl-storable-fixes has been 
updated



- Log -
commit e4b11f15c4a65de8979fb0033ff2872517f0126a
Author: Tony Cook 
Date:   Tue Jan 16 15:50:24 2018 +1100

bump $Storable::VERSION to 2.66

This number will change for the final merge

---

Summary of changes:
 dist/Storable/__Storable__.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dist/Storable/__Storable__.pm b/dist/Storable/__Storable__.pm
index 43d77bce0a..4cc1f2840c 100644
--- a/dist/Storable/__Storable__.pm
+++ b/dist/Storable/__Storable__.pm
@@ -27,7 +27,7 @@ our @EXPORT_OK = qw(
 
 our ($canonical, $forgive_me);
 
-our $VERSION = '2.65';
+our $VERSION = '2.66';
 
 our $recursion_limit;
 our $recursion_limit_hash;

-- 
Perl5 Master Repository


[perl.git] branch blead updated. v5.27.7-146-g45d58ad0e1

2018-01-15 Thread Tony Cook
In perl.git, the branch blead has been updated



- Log -
commit 45d58ad0e10897c87404967eed23f3f290d00fd8
Merge: 1d2af5744d 9769b95f6c
Author: Tony Cook 
Date:   Tue Jan 16 10:56:37 2018 +1100

(perl #132533) updates to Devel::PPPort

commit 9769b95f6c4f605bfd34860a619d9f54387bc13e
Author: Tony Cook 
Date:   Tue Jan 16 10:28:53 2018 +1100

(perl #132533) bump $Devel::PPPort::VERSION

commit 6ac0580f186dac6deaf07dbe98b58392fd0a91f7
Author: Tony Cook 
Date:   Tue Jan 16 10:18:51 2018 +1100

(perl #132533) add missing generated file updates

commit a70a2aeb86bc82dbf40f06ed530a9bbc38916e0f
Author: Pali 
Date:   Sun Dec 3 17:42:14 2017 +0100

Fix test warning: Use of uninitialized value

Function ok() compares values as strings which leads to stringification of
undef and throwing warning.

commit 7ceac2e89b40347b95855c622b9f8f31bd6560f4
Author: Pali 
Date:   Sun Dec 3 17:02:53 2017 +0100

Fix security problem: CWE-134: Use of Externally-Controlled Format String

Function croak() takes printf-like formatted string, so passing arbitrary
char* can leads to buffer overflow. Use croak_sv() which is now available
and avoids converting SV* to char*.

commit 051475ba96b05e8ea21b4fdea8bd58b2644b4d2d
Author: Pali 
Date:   Sun Dec 3 17:01:10 2017 +0100

Use croak_sv in threads

Now when croak_sv is available, there is no need to use croak() with SV* to
char* conversion.

commit f87c37b1822dc27ee027ad18a8de36d3ae1999da
Author: Pali 
Date:   Sun Dec 3 16:57:46 2017 +0100

Implement mess

This patch provides implementation of the following functions:
croak_sv, die_sv, mess_sv, warn_sv, mess, vmess, warn_nocontext,
croak_nocontext, croak_no_modify, croak_memory_wrap, croak_xs_usage

TonyC: add parts/inc/mess to MANIFEST

---

Summary of changes:
 MANIFEST |   2 +
 dist/Devel-PPPort/PPPort_pm.PL   |   8 +-
 dist/Devel-PPPort/parts/inc/HvNAME   |   2 +-
 dist/Devel-PPPort/parts/inc/call |   4 +-
 dist/Devel-PPPort/parts/inc/mess | 527 +++
 dist/Devel-PPPort/parts/inc/ppphtest |   1 +
 dist/Devel-PPPort/parts/inc/threads  |   4 +-
 dist/Devel-PPPort/parts/todo/5006000 |   2 -
 dist/Devel-PPPort/parts/todo/5010001 |   1 -
 dist/Devel-PPPort/parts/todo/5013001 |   4 -
 dist/Devel-PPPort/parts/todo/5013003 |   1 -
 dist/Devel-PPPort/parts/todo/5019003 |   1 -
 dist/Devel-PPPort/t/HvNAME.t |   2 +-
 dist/Devel-PPPort/t/mess.t   | 282 +++
 dist/Devel-PPPort/t/ppphtest.t   |   1 +
 15 files changed, 824 insertions(+), 18 deletions(-)
 create mode 100644 dist/Devel-PPPort/parts/inc/mess
 create mode 100644 dist/Devel-PPPort/t/mess.t

diff --git a/MANIFEST b/MANIFEST
index e1522512fc..1f2bf305b8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3172,6 +3172,7 @@ dist/Devel-PPPort/parts/inc/HvNAMEDevel::PPPort 
include
 dist/Devel-PPPort/parts/inc/limits Devel::PPPort include
 dist/Devel-PPPort/parts/inc/magic  Devel::PPPort include
 dist/Devel-PPPort/parts/inc/memory Devel::PPPort include
+dist/Devel-PPPort/parts/inc/mess   Devel::PPPort include
 dist/Devel-PPPort/parts/inc/misc   Devel::PPPort include
 dist/Devel-PPPort/parts/inc/mPUSH  Devel::PPPort include
 dist/Devel-PPPort/parts/inc/MY_CXT Devel::PPPort include
@@ -3352,6 +3353,7 @@ dist/Devel-PPPort/t/HvNAME.t  Devel::PPPort 
test file
 dist/Devel-PPPort/t/limits.t   Devel::PPPort test file
 dist/Devel-PPPort/t/magic.tDevel::PPPort test file
 dist/Devel-PPPort/t/memory.t   Devel::PPPort test file
+dist/Devel-PPPort/t/mess.t Devel::PPPort test file
 dist/Devel-PPPort/t/misc.t Devel::PPPort test file
 dist/Devel-PPPort/t/mPUSH.tDevel::PPPort test file
 dist/Devel-PPPort/t/MY_CXT.t   Devel::PPPort test file
diff --git a/dist/Devel-PPPort/PPPort_pm.PL b/dist/Devel-PPPort/PPPort_pm.PL
index a44b9c354c..983b6b44bc 100644
--- a/dist/Devel-PPPort/PPPort_pm.PL
+++ b/dist/Devel-PPPort/PPPort_pm.PL
@@ -539,7 +539,7 @@ package Devel::PPPort;
 use strict;
 use vars qw($VERSION $data);
 
-$VERSION = '3.37';
+$VERSION = '3.38';
 
 sub _init_data
 {
@@ -622,6 +622,10 @@ __DATA__
 
 %include misc
 
+%include format
+
+%include mess
+
 %include variables
 
 %include mPUSH
@@ -634,8 +638,6 @@ __DATA__
 
 %include MY_CXT
 
-%include format
-
 %include SvREFCNT
 
 %include newSV_type
diff --git a/dist/Devel-PPPort/parts/inc/HvNAME 
b/dist/Devel-PPPort/parts/inc/HvNAME
index 9b8602bd7e..9fba5029fb 100644
--- a/dist/Devel-PPPort/parts/inc/HvNAME
+++ b/dist/Devel-PPPort/parts/inc/HvNAME
@@ -32,7 +32,7 @@ HvNAMELEN_get(hv)
 =tests plan => 4

[perl.git] branch blead updated. v5.27.7-139-g1d2af5744d

2018-01-15 Thread Karl Williamson
In perl.git, the branch blead has been updated



- Log -
commit 1d2af5744d75143cf7ee8bfd33d4366a95dd1b95
Author: Karl Williamson 
Date:   Sat Jan 13 15:40:34 2018 -0700

Avoid some branches

This replaces some looping with branchless code in two places: looking
for the first UTF-8 variant byte in a string (which is used under
several circumstances), and looking for an ASCII or non-ASCII character
during pattern matching.

Recent commits have changed these operations to do word-at-a-time look-
ups, essentially vectorizing the problem into 4 or 8 parallel probes.
But when the word is found which contains the desired byte, until this
commit, that word would be scanned byte-at-a-time in a loop.

I found some bit hacks on the internet, which when stitched togther, can
find the first desired byte in the word without branching, while doing
this while the word is still loaded, without having to load each byte.

commit 5d0379de16ad15d28efd4497c918e0ed272eb8c3
Author: Karl Williamson 
Date:   Mon Jan 15 15:15:14 2018 -0700

inline.h: Add comment.

---

Summary of changes:
 embed.fnc |   3 ++
 embed.h   |   3 ++
 ext/XS-APItest/APItest.pm |   2 +-
 inline.h  | 108 +-
 proto.h   |   7 +++
 regexec.c |  16 ++-
 6 files changed, 136 insertions(+), 3 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index beb52e8b66..cd654dd1e7 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -806,6 +806,9 @@ AndmoR  |bool   |is_utf8_invariant_string|NN const U8* 
const s  \
 AnidR  |bool   |is_utf8_invariant_string_loc|NN const U8* const s  \
|STRLEN len \
|NULLOK const U8 ** ep
+#ifndef EBCDIC
+AniR   |unsigned int|_variant_byte_number|PERL_UINTMAX_T word
+#endif
 #if defined(PERL_CORE) || defined(PERL_EXT)
 EinR   |Size_t |variant_under_utf8_count|NN const U8* const s  \
|NN const U8* const e
diff --git a/embed.h b/embed.h
index 33c7d493f0..c968191616 100644
--- a/embed.h
+++ b/embed.h
@@ -774,6 +774,9 @@
 #if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO))
 #define csighandlerPerl_csighandler
 #endif
+#if !defined(EBCDIC)
+#define _variant_byte_number   S__variant_byte_number
+#endif
 #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
 #define my_chsize(a,b) Perl_my_chsize(aTHX_ a,b)
 #endif
diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm
index 64022244d5..e30838ae3b 100644
--- a/ext/XS-APItest/APItest.pm
+++ b/ext/XS-APItest/APItest.pm
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 use Carp;
 
-our $VERSION = '0.94';
+our $VERSION = '0.95';
 
 require XSLoader;
 
diff --git a/inline.h b/inline.h
index 1abee4f22f..29ddd2c544 100644
--- a/inline.h
+++ b/inline.h
@@ -438,10 +438,23 @@ S_is_utf8_invariant_string_loc(const U8* const s, STRLEN 
len, const U8 ** ep)
 return FALSE;
 }
 
-/* Otherwise fall into final loop to find which byte it is */
+#if   BYTEORDER == 0x1234 || BYTEORDER == 0x12345678\
+   || BYTEORDER == 0x4321 || BYTEORDER == 0x87654321
+
+*ep = x + _variant_byte_number(* (PERL_UINTMAX_T *) x);
+assert(*ep >= s && *ep < send);
+
+return FALSE;
+
+#else   /* If weird byte order, drop into next loop to do byte-at-a-time
+   checks. */
+
 break;
+#endif
 }
+
 x += PERL_WORDSIZE;
+
 } while (x + PERL_WORDSIZE <= send);
 }
 
@@ -463,6 +476,97 @@ S_is_utf8_invariant_string_loc(const U8* const s, STRLEN 
len, const U8 ** ep)
 return TRUE;
 }
 
+#ifndef EBCDIC
+
+PERL_STATIC_INLINE unsigned int
+S__variant_byte_number(PERL_UINTMAX_T word)
+{
+
+/* This returns the position in a word (0..7) of the first variant byte in
+ * it.  This is a helper function.  Note that there are no branches */
+
+assert(word);
+
+/* Get just the msb bits of each byte */
+word &= PERL_VARIANTS_WORD_MASK;
+
+#  if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678
+
+/* Bytes are stored like
+ *  Byte8 ... Byte2 Byte1
+ *  63..56...15...8 7...0
+ *
+ *  Isolate the lsb;
+ * 
https://stackoverflow.com/questions/757059/position-of-least-significant-bit-that-is-set
+ *
+ * The word will look this this, with a rightmost set bit in position 's':
+ * ('x's are don't cares)
+ *  s
+ *  x..x100..0
+ *  x..xx10..0  Right shift (rightmost 0 is shifted off)
+ *  x..xx01..1  Subtract 1, turns a

[perl.git] branch blead updated. v5.27.7-137-g27169d3827

2018-01-15 Thread Father Chrysostomos
In perl.git, the branch blead has been updated



- Log -
commit 27169d3827c027798ac2b8fbce9fe92773829bd4
Author: Father Chrysostomos 
Date:   Mon Jan 15 12:59:27 2018 -0800

perldiag: miscapitalization

commit edf23316d26dd48a8dd55fac25ffc40f507fdc99
Author: Father Chrysostomos 
Date:   Mon Jan 15 12:57:41 2018 -0800

Sort perldiag

---

Summary of changes:
 pod/perldiag.pod | 31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 0b52fe3853..889375d0a6 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -3009,6 +3009,13 @@ expression pattern should be an indivisible token, with 
nothing
 intervening between the C<"("> and the C<"?">, but you separated them
 with whitespace.
 
+=item In '(+...)', the '(' and '+' must be adjacent in regex;
+marked by S<<-- HERE> in m/%s/
+
+(F) The two-character sequence C<"(+"> in this context in a regular
+expression pattern should be an indivisible token, with nothing
+intervening between the C<"("> and the C<"+">, but you separated them.
+
 =item Invalid %s attribute: %s
 
 (F) The indicated attribute for a subroutine or variable was not recognized
@@ -3166,13 +3173,9 @@ an arbitrary reference was blessed into the "version" 
class.
 =item In '(*VERB...)', the '(' and '*' must be adjacent in regex;
 marked by S<<-- HERE> in m/%s/
 
-=item In '(+...)', the '(' and '+' must be adjacent in regex;
-marked by S<<-- HERE> in m/%s/
-
-(F) The two-character sequences C<"(+"> and C<"(*"> in
-this context in a regular expression pattern should be
-indivisible tokens, with nothing intervening between the C<"(">
-and the C<"*"> or C<"+">, but you separated them.
+(F) The two-character sequence C<"(*"> in this context in a regular
+expression pattern should be an indivisible token, with nothing
+intervening between the C<"("> and the C<"*">, but you separated them.
 
 =item ioctl is not implemented
 
@@ -6093,13 +6096,19 @@ according to the probings of Configure.
 (S experimental::regex_sets) This warning is emitted if you
 use the syntax S> in a regular expression.
 The details of this feature are subject to change.
-if you want to use it, but know that in doing so you
+If you want to use it, but know that in doing so you
 are taking the risk of using an experimental feature which may
 change in a future Perl version, you can do this to silence the
 warning:
 
 no warnings "experimental::regex_sets";
 
+=item The script_run feature is experimental
+
+(S experimental::script_run) This feature is experimental
+and its behavior may in any future release of perl.  See
+L.
+
 =item The signatures feature is experimental
 
 (S experimental::signatures) This warning is emitted if you unwrap a
@@ -6112,12 +6121,6 @@ in a future Perl version:
 use feature "signatures";
 sub foo ($left, $right) { ... }
 
-=item The script_run feature is experimental
-
-(S experimental::script_run) This feature is experimental and its
-behavior may in any future release of perl.
-See L.
-
 =item The stat preceding %s wasn't an lstat
 
 (F) It makes no sense to test the current stat buffer for symbolic

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale deleted. v5.27.7-174-gce313228b8

2018-01-15 Thread Karl Williamson
In perl.git, the branch smoke-me/khw-locale has been deleted



   was  ce313228b8c28feb992253d950cca3761f1bbb07

- Log -
ce313228b8c28feb992253d950cca3761f1bbb07 POSIX.xs: Prefer mbrtowc() over 
mbtowc()
---

-- 
Perl5 Master Repository


[perl.git] branch smoke-me/khw-locale created. v5.27.7-182-g3145fe5dc9

2018-01-15 Thread Karl Williamson
In perl.git, the branch smoke-me/khw-locale has been created



at  3145fe5dc9f4b8132cf47809afecb548dc0a8547 (commit)

- Log -
commit 3145fe5dc9f4b8132cf47809afecb548dc0a8547
Author: Karl Williamson 
Date:   Mon Jan 15 13:19:03 2018 -0700

f

commit 41046cb70d275ebac3c5f1c3b6f60a0d12fb2143
Author: Karl Williamson 
Date:   Sun Jan 14 22:21:31 2018 -0700

for debug Carlos

commit 2d54243bf03a4e353e5237b8c4c96d29491eeeb5
Author: Karl Williamson 
Date:   Sun Jan 14 21:43:43 2018 -0700

toke.c: Remove unnecessary macro calls

These macros were to shift the LC_NUMERIC state into using a dot for the
radix character.  When I wrote this code, I assumed that parsing should
be using just the dot.  Since then, I have discovered that this wraps
other uses where the dot is not correct, so remove it.

commit 452b5b98e159966365c88ceafa43e7dbd026f83a
Author: Karl Williamson 
Date:   Sun Jan 14 21:37:16 2018 -0700

perl.h: Remove unused locale core macro

This undocumented macro is unused in the core, and all these are
commented that they are subject to change.  And it confuses things, so
just remove it.

commit 929f824700748dee2e45189057452140413aba5e
Author: Karl Williamson 
Date:   Sun Jan 14 20:26:44 2018 -0700

perlapi: Clarification

commit bcfa887e1d26a0eac3951f3667a941c223cecb80
Author: Karl Williamson 
Date:   Wed Jan 10 22:35:12 2018 -0700

POSIX.xs: Prefer mbrtowc() over mbtowc()

mbrtowc is reentrant, so use it on threaded perls if available when
POSIX::mbtowc() is called.

commit 5b710bb68eee98db499e36c697b09033b4db1118
Author: Karl Williamson 
Date:   Wed Jan 10 22:28:34 2018 -0700

POSIX.xs: Prefer mbrlen() over mblen()

mbrlen is reentrant, so use it on threaded perls if available when
POSIX::mblen() is called.

commit 86721664481d8e99a24ac58104185bdf7d79b9b6
Author: Karl Williamson 
Date:   Wed Jan 10 17:10:09 2018 -0700

l

commit 7ec302c329c2ae8ca5c69aca88069f90b2bfefc1
Author: Karl Williamson 
Date:   Mon Jan 8 18:21:12 2018 -0700

locale.c: Revamp fallback detection of UTF-8 locales

This commit continues the process started in the previous few commits to
improve the detection of whether a locale is UTF-8 or not when the
platform doesn't have the more modern tools available.

What was done before was examine various texts, like the days of the
week, in a locale, and see if they are legal UTF-8 or not.  If there
were any, and all were legal, it assumed that UTF-8 was needed.  If
there weren't any (as in American English), it looked at the locale's
name.  This presents false negatives and false positives.

Basically, it adds the constraint that all the texts need to be in the
same script when interpreted as UTF-8, which basically rules out any
false positives when the script isn't Latin.  With Latin, it isn't so
clear cut, as the text can be intermixed with ASCII Latin letters and
UTF-8 variant sequences that could be some Latin locale, or UTF-8, and
they just coincidentally happen to be syntactically UTF-8.  Because of
the structuredness of UTF-8, the odds of a coincidence go down with
increasing numbers of variants in a row.  This also isn't likely to
happen with ISO 8859-1, as the bytes that could be legal continuations
in UTF-8 are almost entirely controls or punctuation.  But in other
locales in the 8859 series, there are some legal continuations that
could be part of a month name, say.

As an example of the issues, in 8859-2, one could have \xC6 (C with
acute) followed by \xB1 (a with ogonek), which in UTF-8 would be
U+01B1: LATIN CAPITAL LETTER UPSILON.  However, something like \xCD
(i acute) followed by \xB3 (l with stroke) yields U+0373: GREEK
SMALL LETTER ARCHAIC SAMPI, and the script check added by this commit
would catch that.  In non-Latin texts, the only permissible ASCII
characters would be punctuation, and you aren't going to have many of
those in the LC_TIME strings, and certainly not in a row.  Instead those
will consist of at least several variant characters in a row, and the
odds of those coincidentally being syntactically valid UTF-8 and
semantically in the same script are exceedingly low.

To catch Latin UTF-8 locales, this commit adds a list of the distinct
variants found so far.  If there are even just several of these, the
odds of the syntax being coincidentally UTF-8 greatly diminish.  The
number needed for this to conclude that the locale is UTF-8, is easily
tweakable at compile time.

The problem remains for English and other Latin script languages that
have rare accented characters.  The name is still then ex

[perl.git] branch blead updated. v5.27.7-135-g669d6ad814

2018-01-15 Thread Craig A. Berry
In perl.git, the branch blead has been updated



- Log -
commit 669d6ad81497efd33243c692e6f057f97c6c1567
Author: Craig A. Berry 
Date:   Sun Jan 14 13:42:05 2018 -0600

VMS does have fchmod and fchown.

The test for fchmod in t/io/fs.t does, however, reveal a wrinkle
that is also true of chmod on VMS: a mode argument of zero does
not mean turn off all permisions but rather set permissions to the
user's default.  This is probably an ancient behavior from
pre-standard days.  For now, just skip the affected test and
document what's different.

---

Summary of changes:
 configure.com| 9 +++--
 pod/perlport.pod | 4 
 t/io/fs.t| 1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/configure.com b/configure.com
index e060f455ab..8cb8afe68f 100644
--- a/configure.com
+++ b/configure.com
@@ -6021,9 +6021,14 @@ $ WC "d_erfc='" + d_erfc + "'"
 $ WC "d_eunice='undef'"
 $ WC "d_exp2='" + d_exp2 + "'"
 $ WC "d_expm1='" + d_expm1 + "'"
-$ WC "d_fchmod='undef'"
+$ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."8.3")
+$ THEN
+$   WC "d_fchmod='define'"
+$ ELSE
+$   WC "d_fchmod='undef'"
+$ ENDIF
 $ WC "d_fchdir='undef'"
-$ WC "d_fchown='undef'"
+$ WC "d_fchown='define'"
 $ WC "d_fcntl='" + d_fcntl + "'"
 $ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
 $ WC "d_fd_set='" + d_fd_set + "'"
diff --git a/pod/perlport.pod b/pod/perlport.pod
index 36c217d4ec..45158d58d6 100644
--- a/pod/perlport.pod
+++ b/pod/perlport.pod
@@ -1591,6 +1591,10 @@ in the SYSTEM environment settings.
 Setting the exec bit on some locations (generally F) will return true
 but not actually set the bit.
 
+(VMS)
+A mode argument of zero sets permissions to the user's default permission mask
+rather than disabling all permissions.
+
 =item chown
 
 (S, S)
diff --git a/t/io/fs.t b/t/io/fs.t
index 09eede1e44..f35b907d5d 100644
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -192,6 +192,7 @@ SKIP: {
 $mode = (stat "a")[2];
 SKIP: {
 skip "no mode checks", 1 if $skip_mode_checks;
+skip "chmod(0, FH) means assume user defaults on VMS", 1 if $^O eq 
'VMS';
 is($mode & 0777, 0, "perm reset");
 }
 is(chmod($newmode, "a"), 1, "fchmod");

-- 
Perl5 Master Repository