Skip to content

Commit 97ebff2

Browse files
committed
Integrate changes #7971(perlio),8982,9061,9062,9068,9069,
9079,9083,9089,9090,9091 from mainline to maintperl. Quieten some noise in Win32 builds Fixes the bugs 20010221.005 and 20010221.008: "the taint checker..." The perlretut was still talking about the old \p and \P definitions. More tweakage on the Unicode character class descriptions. Subject: Re: [ID 20010305.012] chop() against list assignment returns char chopped from el zero Subject: 'no *POSIX' Patch speeding up make on BS2000 Subject: [PATCH] perldata.pod here-doc docs Add /sbin and /usr/sbin to the list of directories scanned for setuid programs. Takes care of bug id 20010309.003. Subject: Re: [ID 19990808.001] [PATCH] FETCH triggered on exists() In op/stat #35 better to scan all the potential directories for setuids, not just the first one. p4raw-link: @7971 on //depot/perlio: b474837 p4raw-id: //depot/maint-5.6/perl@9230 p4raw-integrated: from //depot/perlio@7971 'edit in' doio.c (@7859..) 'merge in' perl.h (@7945..) toke.c (@7960..) win32/win32.h (@7970..) p4raw-integrated: from //depot/perl@9229 'copy in' makedepend.SH (@5930..) t/op/chop.t (@8824..) pod/perldata.pod (@8979..) pod/perlretut.pod (@9061..) t/op/stat.t (@9089..) 'edit in' doio.c (@8963..) 'merge in' hv.c (@8919..) p4raw-edited: from //depot/perl@9069 'edit in' Makefile.SH (@8879..) p4raw-integrated: from //depot/perl@9068 'merge in' pp.c (@8966..) p4raw-integrated: from //depot/perl@9062 'merge in' lib/unicode/mktables.PL (@8771..)
1 parent b98e425 commit 97ebff2

File tree

13 files changed

+108
-46
lines changed

13 files changed

+108
-46
lines changed

Makefile.SH

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ case "$osname" in
132132
;;
133133
esac
134134

135+
# Handle the usage of different yaccs in posix-bc (During Configure we
136+
# us yacc for perly.y and byacc for a2p.y. The makefiles must use the
137+
# same configuration for run_byacc!):
138+
case "$osname" in
139+
posix-bc)
140+
byacc=$yacc
141+
;;
142+
esac
143+
135144
echo "Extracting Makefile (with variable substitutions)"
136145
$spitshell >Makefile <<!GROK!THIS!
137146
# Makefile.SH
@@ -319,7 +328,7 @@ FORCE:
319328
$spitshell >>Makefile <<!GROK!THIS!
320329
opmini\$(OBJ_EXT): op.c config.h
321330
\$(RMS) opmini.c
322-
\$(LNS) op.c opmini.c
331+
\$(CPS) op.c opmini.c
323332
\$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
324333
\$(RMS) opmini.c
325334

doio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,11 +1279,11 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
12791279
(really && *tmps != '/')) /* will execvp use PATH? */
12801280
TAINT_ENV(); /* testing IFS here is overkill, probably */
12811281
if (really && *tmps)
1282-
PerlProc_execvp(tmps,PL_Argv);
1282+
PerlProc_execvp(tmps,EXEC_ARGV_CAST(PL_Argv));
12831283
else
1284-
PerlProc_execvp(PL_Argv[0],PL_Argv);
1284+
PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv));
12851285
if (ckWARN(WARN_EXEC))
1286-
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
1286+
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
12871287
(really ? tmps : PL_Argv[0]), Strerror(errno));
12881288
if (do_report) {
12891289
int e = errno;

hv.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,12 @@ Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
793793

794794
if (SvRMAGICAL(hv)) {
795795
if (mg_find((SV*)hv,'P')) {
796+
SV* svret = sv_newmortal();
796797
sv = sv_newmortal();
797798
keysv = sv_2mortal(newSVsv(keysv));
798-
mg_copy((SV*)hv, sv, (char*)keysv, HEf_SVKEY);
799-
magic_existspack(sv, mg_find(sv, 'p'));
800-
return SvTRUE(sv);
799+
mg_copy((SV*)hv, sv, (char*)keysv, HEf_SVKEY);
800+
magic_existspack(svret, mg_find(sv, 'p'));
801+
return SvTRUE(svret);
801802
}
802803
#ifdef ENV_IS_CASELESS
803804
else if (mg_find((SV*)hv,'E')) {

lib/unicode/mktables.PL

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ mkdir "To", 0755;
3131
['IsSpacePerl',
3232
'$cat =~ /^Z/ ||
3333
$code =~ /^(0009|000A|000C|000D)$/', ''],
34-
['IsBlank', '$cat =~ /^Z[^lp]$/ || $code eq "0009"', ''],
34+
['IsBlank', '$code =~ /^(0020|0009)$/ ||
35+
$cat =~ /^Z[^lp]$/', ''],
3536
['IsDigit', '$cat =~ /^Nd$/', ''],
3637
['IsUpper', '$cat =~ /^L[ut]$/', ''],
3738
['IsLower', '$cat =~ /^Ll$/', ''],

makedepend.SH

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ for file in `$cat .clist`; do
108108
if [ "$archname" = cygwin ]; then
109109
uwinfix="-e s,\\\\\\\\,/,g"
110110
else
111-
uwinfix=
111+
if [ "$osname" = posix-bc ]; then
112+
uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/"
113+
else
114+
uwinfix=
115+
fi
112116
fi
113117
fi
114118
fi

perl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,10 @@ typedef struct perl_mstats perl_mstats_t;
705705

706706
#include <errno.h>
707707

708+
#if defined(WIN32) && (defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI))
709+
# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */
710+
#endif
711+
708712
#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
709713
# include <sys/socket.h>
710714
# if defined(USE_SOCKS) && defined(I_SOCKS)
@@ -3434,6 +3438,10 @@ typedef struct am_table_short AMTS;
34343438
# include <libutil.h> /* setproctitle() in some FreeBSDs */
34353439
#endif
34363440

3441+
#ifndef EXEC_ARGV_CAST
3442+
#define EXEC_ARGV_CAST(x) x
3443+
#endif
3444+
34373445
/* and finally... */
34383446
#define PERL_PATCHLEVEL_H_IMPLICIT
34393447
#include "patchlevel.h"

pod/perldata.pod

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,20 +413,20 @@ string may be either an identifier (a word), or some quoted text. If
413413
quoted, the type of quotes you use determines the treatment of the
414414
text, just as in regular quoting. An unquoted identifier works like
415415
double quotes. There must be no space between the C<< << >> and
416-
the identifier. (If you put a space it will be treated as a null
417-
identifier, which is valid, and matches the first empty line.) The
418-
terminating string must appear by itself (unquoted and with no
419-
surrounding whitespace) on the terminating line.
416+
the identifier, unless the identifier is quoted. (If you put a space it
417+
will be treated as a null identifier, which is valid, and matches the first
418+
empty line.) The terminating string must appear by itself (unquoted and
419+
with no surrounding whitespace) on the terminating line.
420420

421421
print <<EOF;
422422
The price is $Price.
423423
EOF
424424

425-
print <<"EOF"; # same as above
425+
print << "EOF"; # same as above
426426
The price is $Price.
427427
EOF
428428

429-
print <<`EOC`; # execute commands
429+
print << `EOC`; # execute commands
430430
echo hi there
431431
echo lo there
432432
EOC
@@ -437,7 +437,7 @@ surrounding whitespace) on the terminating line.
437437
I said bar.
438438
bar
439439

440-
myfunc(<<"THIS", 23, <<'THAT');
440+
myfunc(<< "THIS", 23, <<'THAT');
441441
Here's a line
442442
or two.
443443
THIS
@@ -478,6 +478,23 @@ you have to write
478478
the other
479479
E
480480

481+
If the terminating identifier is on the last line of the program, you
482+
must be sure there is a newline after it; otherwise, Perl will give the
483+
warning B<Can't find string terminator "END" anywhere before EOF...>.
484+
485+
Additionally, the quoting rules for the identifier are not related to
486+
Perl's quoting rules -- C<q()>, C<qq()>, and the like are not supported
487+
in place of C<''> and C<"">, and the only interpolation is for backslashing
488+
the quoting character:
489+
490+
print << "abc\"def";
491+
testing...
492+
abc"def
493+
494+
Finally, quoted strings cannot span multiple lines. The general rule is
495+
that the identifier must be a string literal. Stick with that, and you
496+
should be safe.
497+
481498
=head2 List value constructors
482499

483500
List values are denoted by separating individual values by commas

pod/perlretut.pod

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,29 +1720,32 @@ characters,
17201720
$x =~ /^\p{IsLower}/; # doesn't match, lowercase char class
17211721
$x =~ /^\P{IsLower}/; # matches, char class sans lowercase
17221722

1723-
If a C<name> is just one letter, the braces can be dropped. For
1724-
instance, C<\pM> is the character class of Unicode 'marks'. Here is
1725-
the association between some Perl named classes and the traditional
1726-
Unicode classes:
1723+
Here is the association between some Perl named classes and the
1724+
traditional Unicode classes:
17271725

1728-
Perl class name Unicode class name
1726+
Perl class name Unicode class name or regular expression
17291727

1730-
IsAlpha Lu, Ll, or Lo
1731-
IsAlnum Lu, Ll, Lo, or Nd
1732-
IsASCII $code le 127
1733-
IsCntrl C
1728+
IsAlpha /^[LM]/
1729+
IsAlnum /^[LMN]/
1730+
IsASCII $code <= 127
1731+
IsCntrl /^C/
1732+
IsBlank $code =~ /^(0020|0009)$/ || /^Z[^lp]/
17341733
IsDigit Nd
1735-
IsGraph [^C] and $code ne "0020"
1734+
IsGraph /^([LMNPS]|Co)/
17361735
IsLower Ll
1737-
IsPrint [^C]
1738-
IsPunct P
1739-
IsSpace Z, or ($code lt "0020" and chr(hex $code) is a \s)
1740-
IsUpper Lu
1741-
IsWord Lu, Ll, Lo, Nd or $code eq "005F"
1736+
IsPrint /^([LMNPS]|Co|Zs)/
1737+
IsPunct /^P/
1738+
IsSpace /^Z/ || ($code =~ /^(0009|000A|000B|000C|000D)$/
1739+
IsSpacePerl /^Z/ || ($code =~ /^(0009|000A|000C|000D)$/
1740+
IsUpper /^L[ut]/
1741+
IsWord /^[LMN]/ || $code eq "005F"
17421742
IsXDigit $code =~ /^00(3[0-9]|[46][1-6])$/
17431743

1744-
For a full list of Perl class names, consult the mktables.PL program
1745-
in the lib/perl5/5.6.0/unicode directory.
1744+
You can also use the official Unicode class names with the C<\p> and
1745+
C<\P>, like C<\p{L}> for Unicode 'letters', or C<\p{Lu}> for uppercase
1746+
letters, or C<\P{Nd}> for non-digits. If a C<name> is just one
1747+
letter, the braces can be dropped. For instance, C<\pM> is the
1748+
character class of Unicode 'marks'.
17461749

17471750
C<\X> is an abbreviation for a character class sequence that includes
17481751
the Unicode 'combining character sequences'. A 'combining character

pp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ PP(pp_schop)
737737

738738
PP(pp_chop)
739739
{
740-
djSP; dMARK; dTARGET;
741-
while (SP > MARK)
742-
do_chop(TARG, POPs);
740+
djSP; dMARK; dTARGET; dORIGMARK;
741+
while (MARK < SP)
742+
do_chop(TARG, *++MARK);
743743
PUSHTARG;
744744
RETURN;
745745
}

t/op/chop.t

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!./perl
22

3-
print "1..33\n";
3+
print "1..37\n";
44

55
# optimized
66

@@ -103,3 +103,16 @@ print $_ eq "abc\x{1234}" ? "ok 32\n" : "not ok 32\n";
103103
$_ = "\x{1234}\x{2345}";
104104
chop;
105105
print $_ eq "\x{1234}" ? "ok 33\n" : "not ok 33\n";
106+
107+
my @stuff = qw(this that);
108+
print chop(@stuff[0,1]) eq 't' ? "ok 34\n" : "not ok 34\n";
109+
110+
# bug id 20010305.012
111+
@stuff = qw(ab cd ef);
112+
print chop(@stuff = @stuff) eq 'f' ? "ok 35\n" : "not ok 35\n";
113+
114+
@stuff = qw(ab cd ef);
115+
print chop(@stuff[0, 2]) eq 'f' ? "ok 36\n" : "not ok 36\n";
116+
117+
my %stuff = (1..4);
118+
print chop(@stuff{1, 3}) eq '4' ? "ok 37\n" : "not ok 37\n";

t/op/stat.t

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,18 @@ if ($^O eq 'mpeix' or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) {
178178
$cnt = $uid = 0;
179179

180180
die "Can't run op/stat.t test 35 without pwd working" unless $cwd;
181-
($bin) = grep {-d} ($^O eq 'machten' ? qw(/usr/bin /bin) : qw(/bin /usr/bin))
182-
or print ("not ok 35\n"), goto tty_test;
183-
opendir BIN, $bin or die "Can't opendir $bin: $!";
184-
while (defined($_ = readdir BIN)) {
185-
$_ = "$bin/$_";
186-
$cnt++;
187-
$uid++ if -u;
188-
last if $uid && $uid < $cnt;
181+
my @bin = grep {-d} ($^O eq 'machten' ?
182+
qw(/usr/bin /bin) :
183+
qw(/sbin /usr/sbin /bin /usr/bin));
184+
unless (@bin) { print ("not ok 35\n"), goto tty_test; }
185+
for my $bin (@bin) {
186+
opendir BIN, $bin or die "Can't opendir $bin: $!";
187+
while (defined($_ = readdir BIN)) {
188+
$_ = "$bin/$_";
189+
$cnt++;
190+
$uid++ if -u;
191+
last if $uid && $uid < $cnt;
192+
}
189193
}
190194
closedir BIN;
191195

toke.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,7 @@ Perl_yylex(pTHX)
27332733
else
27342734
newargv = PL_origargv;
27352735
newargv[0] = ipath;
2736-
PerlProc_execv(ipath, newargv);
2736+
PerlProc_execv(ipath, EXEC_ARGV_CAST(newargv));
27372737
Perl_croak(aTHX_ "Can't exec %s", ipath);
27382738
}
27392739
#endif

win32/win32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,5 +545,7 @@ EXTERN_C _CRTIMP ioinfo* __pioinfo[];
545545
*/
546546
#include "win32iop.h"
547547

548+
#define EXEC_ARGV_CAST(x) ((const char *const *) x)
549+
548550
#endif /* _INC_WIN32_PERL5 */
549551

0 commit comments

Comments
 (0)