This patch describes the changes made in ActivePerl build 615 over the official Perl v5.6.0 sources. Summary of changes in build 615: * Make "perl -V" output reflect ActiveState build. * Add Win32::BuildNumber() for compatibility. * Add resources to perl.exe and perl56.dll. The ActivePerl Release Notes contain an informal summary of these changes. These can be viewed at: http://www.ActiveState.com/ActivePerl/docs/CHANGES.html The included patch may be applied to Perl v5.6.0 sources using the GNU patch utility. e.g: % cd perl-5.6.0 % patch -lNp1 < this_file --------------------------------------------------------------------------- diff -ruN perl-5.6.0/BuildInfo.h AP615_source/BuildInfo.h --- perl-5.6.0/BuildInfo.h Wed Dec 31 16:00:00 1969 +++ AP615_source/BuildInfo.h Wed Jul 5 12:22:23 2000 @@ -0,0 +1,24 @@ +/* BuildInfo.h + * + * (c) 1998 ActiveState Tool Corp. All rights reserved. + * + */ + +#ifndef ___BuildInfo__h___ +#define ___BuildInfo__h___ + +#define PRODUCT_BUILD_NUMBER "615" +#define PERLFILEVERSION "5,6,0,615\0" +#define PERLRC_VERSION 5,6,0,615 +#define PERLPRODUCTVERSION "Build " PRODUCT_BUILD_NUMBER "\0" +#define PERLPRODUCTNAME "ActivePerl\0" + +#define PERL_VENDORLIB_NAME "ActiveState" + +#define ACTIVEPERL_VERSION "Built "##__TIME__##" "##__DATE__##"\n" +#define ACTIVEPERL_LOCAL_PATCHES_ENTRY "ActivePerl Build " PRODUCT_BUILD_NUMBER +#define BINARY_BUILD_NOTICE printf("\n\ +Binary build "##PRODUCT_BUILD_NUMBER##" provided by ActiveState Tool Corp. http://www.ActiveState.com\n\ +" ACTIVEPERL_VERSION "\n"); + +#endif /* ___BuildInfo__h___ */ diff -ruN perl-5.6.0/Configure AP615_source/Configure --- perl-5.6.0/Configure Wed Jul 5 14:34:01 2000 +++ AP615_source/Configure Thu Jun 29 14:48:34 2000 @@ -992,7 +992,11 @@ : List of libraries we want. : If anyone needs -lnet, put it in a hint file. -libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl' +# XXX These libs are not used by perl itself. They were initially +# added to help platforms like SunOS that have funky dynamic loading +# requirements, but most modern platforms can cope without them. +#libswanted='ndbm gdbm dbm db' +libswanted='sfio socket bind inet nsl nm malloc dl' libswanted="$libswanted dld ld sun m c cposix posix" libswanted="$libswanted ndir dir crypt sec" libswanted="$libswanted ucb bsd BSD PW x iconv" diff -ruN perl-5.6.0/MANIFEST AP615_source/MANIFEST --- perl-5.6.0/MANIFEST Wed Jul 5 14:34:01 2000 +++ AP615_source/MANIFEST Thu Jun 29 08:28:34 2000 @@ -1295,6 +1295,7 @@ t/lib/soundex.t See if Soundex works t/lib/symbol.t See if Symbol works t/lib/syslfs.t See if large files work for sysio +t/lib/syslog.t See if Sys::Syslog works t/lib/textfill.t See if Text::Wrap::fill works t/lib/texttabs.t See if Text::Tabs works t/lib/textwrap.t See if Text::Wrap::wrap works diff -ruN perl-5.6.0/README.win32 AP615_source/README.win32 --- perl-5.6.0/README.win32 Wed Jul 5 14:34:03 2000 +++ AP615_source/README.win32 Thu Jun 29 08:30:39 2000 @@ -193,9 +193,9 @@ Type "dmake test" (or "nmake test"). This will run most of the tests from the testsuite (many tests will be skipped). -No tests should typically fail when running Windows NT 4.0. Under Windows -2000, test 22 in lib/open3.t is known to fail (cause still unknown). Many -tests will fail under Windows 9x due to the inferior command shell. +There should be no test failures when running under Windows NT 4.0 or +Windows 2000. Many tests I fail under Windows 9x due to the inferior +command shell. Some test failures may occur if you use a command shell other than the native "cmd.exe", or if you are building from a path that contains diff -ruN perl-5.6.0/av.h AP615_source/av.h --- perl-5.6.0/av.h Wed Jul 5 14:34:03 2000 +++ AP615_source/av.h Thu Jun 29 08:38:17 2000 @@ -32,8 +32,8 @@ * real if the array needs to be modified in some way. Functions that * modify fake AVs check both flags to call av_reify() as appropriate. * - * Note that the Perl stack has neither flag set. (Thus, items that go - * on the stack are never refcounted.) + * Note that the Perl stack and @DB::args have neither flag set. (Thus, + * items that go on the stack are never refcounted.) * * These internal details are subject to change any time. AV * manipulations external to perl should not care about any of this. diff -ruN perl-5.6.0/cop.h AP615_source/cop.h --- perl-5.6.0/cop.h Wed Jul 5 14:34:04 2000 +++ AP615_source/cop.h Thu Jun 29 08:38:22 2000 @@ -29,32 +29,33 @@ # define CopFILE(c) ((c)->cop_file) # define CopFILEGV(c) (CopFILE(c) \ ? gv_fetchfile(CopFILE(c)) : Nullgv) -# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) /* XXX */ +# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) # define CopFILESV(c) (CopFILE(c) \ ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) # define CopFILEAV(c) (CopFILE(c) \ ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) # define CopSTASHPV(c) ((c)->cop_stashpv) -# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savepv(pv)) /* XXX */ +# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savepv(pv)) # define CopSTASH(c) (CopSTASHPV(c) \ ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) # define CopSTASH_set(c,hv) CopSTASHPV_set(c, HvNAME(hv)) -# define CopSTASH_eq(c,hv) (hv \ +# define CopSTASH_eq(c,hv) ((hv) \ && (CopSTASHPV(c) == HvNAME(hv) \ || (CopSTASHPV(c) && HvNAME(hv) \ && strEQ(CopSTASHPV(c), HvNAME(hv))))) #else # define CopFILEGV(c) ((c)->cop_filegv) -# define CopFILEGV_set(c,gv) ((c)->cop_filegv = gv) -# define CopFILE_set(c,pv) ((c)->cop_filegv = gv_fetchfile(pv)) +# define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) +# define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv)) # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv) # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav) # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch) # define CopSTASH(c) ((c)->cop_stash) -# define CopSTASH_set(c,hv) ((c)->cop_stash = hv) +# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv)) # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch) -# define CopSTASHPV_set(c,pv) CopSTASH_set(c, gv_stashpv(pv,GV_ADD)) -# define CopSTASH_eq(c,hv) (CopSTASH(c) == hv) + /* cop_stash is not refcounted */ +# define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD)) +# define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv)) #endif /* USE_ITHREADS */ #define CopSTASH_ne(c,hv) (!CopSTASH_eq(c,hv)) @@ -105,13 +106,14 @@ } STMT_END #endif /* USE_THREADS */ -#ifdef USE_ITHREADS - /* junk in @_ spells trouble when cloning CVs, so don't leave any */ -# define CLEAR_ARGARRAY() av_clear(cx->blk_sub.argarray) -#else -# define CLEAR_ARGARRAY() NOOP -#endif /* USE_ITHREADS */ - +/* junk in @_ spells trouble when cloning CVs and in pp_caller(), so don't + * leave any (a fast av_clear(ary), basically) */ +#define CLEAR_ARGARRAY(ary) \ + STMT_START { \ + AvMAX(ary) += AvARRAY(ary) - AvALLOC(ary); \ + SvPVX(ary) = (char*)AvALLOC(ary); \ + AvFILLp(ary) = -1; \ + } STMT_END #define POPSUB(cx,sv) \ STMT_START { \ @@ -127,7 +129,7 @@ PL_curpad[0] = (SV*)cx->blk_sub.argarray; \ } \ else { \ - CLEAR_ARGARRAY(); \ + CLEAR_ARGARRAY(cx->blk_sub.argarray); \ } \ } \ sv = (SV*)cx->blk_sub.cv; \ @@ -423,6 +425,7 @@ #define G_NOARGS 8 /* Don't construct a @_ array. */ #define G_KEEPERR 16 /* Append errors to $@, don't overwrite it */ #define G_NODEBUG 32 /* Disable debugging at toplevel. */ +#define G_METHOD 64 /* Calling method. */ /* flag bits for PL_in_eval */ #define EVAL_NULL 0 /* not in an eval */ diff -ruN perl-5.6.0/doop.c AP615_source/doop.c --- perl-5.6.0/doop.c Wed Jul 5 14:34:04 2000 +++ AP615_source/doop.c Thu Jun 29 08:36:59 2000 @@ -660,12 +660,9 @@ if (items-- > 0) { char *s; - if (*mark) { - s = SvPV(*mark, tmplen); - sv_setpvn(sv, s, tmplen); - } - else - sv_setpv(sv, ""); + sv_setpv(sv, ""); + if (*mark) + sv_catsv(sv, *mark); mark++; } else @@ -697,6 +694,7 @@ SvTAINTED_on(sv); } +/* XXX SvUTF8 support missing! */ UV Perl_do_vecget(pTHX_ SV *sv, I32 offset, I32 size) { @@ -829,6 +827,7 @@ return retnum; } +/* XXX SvUTF8 support missing! */ void Perl_do_vecset(pTHX_ SV *sv) { @@ -844,6 +843,7 @@ if (!targ) return; s = (unsigned char*)SvPV_force(targ, targlen); + (void)SvPOK_only(targ); lval = SvUV(sv); offset = LvTARGOFF(sv); size = LvTARGLEN(sv); diff -ruN perl-5.6.0/embed.h AP615_source/embed.h --- perl-5.6.0/embed.h Wed Jul 5 14:34:06 2000 +++ AP615_source/embed.h Thu Jun 29 08:37:05 2000 @@ -269,6 +269,7 @@ #define instr Perl_instr #define io_close Perl_io_close #define invert Perl_invert +#define is_gv_magical Perl_is_gv_magical #define is_uni_alnum Perl_is_uni_alnum #define is_uni_alnumc Perl_is_uni_alnumc #define is_uni_idfirst Perl_is_uni_idfirst @@ -570,6 +571,7 @@ #define save_freeop Perl_save_freeop #define save_freepv Perl_save_freepv #define save_generic_svref Perl_save_generic_svref +#define save_generic_pvref Perl_save_generic_pvref #define save_gp Perl_save_gp #define save_hash Perl_save_hash #define save_helem Perl_save_helem @@ -830,6 +832,9 @@ #define ptr_table_store Perl_ptr_table_store #define ptr_table_split Perl_ptr_table_split #endif +#if defined(HAVE_INTERP_INTERN) +#define sys_intern_init Perl_sys_intern_init +#endif #if defined(PERL_OBJECT) #else #endif @@ -1716,6 +1721,7 @@ #define instr(a,b) Perl_instr(aTHX_ a,b) #define io_close(a,b) Perl_io_close(aTHX_ a,b) #define invert(a) Perl_invert(aTHX_ a) +#define is_gv_magical(a,b,c) Perl_is_gv_magical(aTHX_ a,b,c) #define is_uni_alnum(a) Perl_is_uni_alnum(aTHX_ a) #define is_uni_alnumc(a) Perl_is_uni_alnumc(aTHX_ a) #define is_uni_idfirst(a) Perl_is_uni_idfirst(aTHX_ a) @@ -2014,6 +2020,7 @@ #define save_freeop(a) Perl_save_freeop(aTHX_ a) #define save_freepv(a) Perl_save_freepv(aTHX_ a) #define save_generic_svref(a) Perl_save_generic_svref(aTHX_ a) +#define save_generic_pvref(a) Perl_save_generic_pvref(aTHX_ a) #define save_gp(a,b) Perl_save_gp(aTHX_ a,b) #define save_hash(a) Perl_save_hash(aTHX_ a) #define save_helem(a,b,c) Perl_save_helem(aTHX_ a,b,c) @@ -2266,6 +2273,9 @@ #define ptr_table_store(a,b,c) Perl_ptr_table_store(aTHX_ a,b,c) #define ptr_table_split(a) Perl_ptr_table_split(aTHX_ a) #endif +#if defined(HAVE_INTERP_INTERN) +#define sys_intern_init() Perl_sys_intern_init(aTHX) +#endif #if defined(PERL_OBJECT) #else #endif @@ -3361,6 +3371,8 @@ #define io_close Perl_io_close #define Perl_invert CPerlObj::Perl_invert #define invert Perl_invert +#define Perl_is_gv_magical CPerlObj::Perl_is_gv_magical +#define is_gv_magical Perl_is_gv_magical #define Perl_is_uni_alnum CPerlObj::Perl_is_uni_alnum #define is_uni_alnum Perl_is_uni_alnum #define Perl_is_uni_alnumc CPerlObj::Perl_is_uni_alnumc @@ -3944,6 +3956,8 @@ #define save_freepv Perl_save_freepv #define Perl_save_generic_svref CPerlObj::Perl_save_generic_svref #define save_generic_svref Perl_save_generic_svref +#define Perl_save_generic_pvref CPerlObj::Perl_save_generic_pvref +#define save_generic_pvref Perl_save_generic_pvref #define Perl_save_gp CPerlObj::Perl_save_gp #define save_gp Perl_save_gp #define Perl_save_hash CPerlObj::Perl_save_hash @@ -4440,6 +4454,10 @@ #define ptr_table_store Perl_ptr_table_store #define Perl_ptr_table_split CPerlObj::Perl_ptr_table_split #define ptr_table_split Perl_ptr_table_split +#endif +#if defined(HAVE_INTERP_INTERN) +#define Perl_sys_intern_init CPerlObj::Perl_sys_intern_init +#define sys_intern_init Perl_sys_intern_init #endif #if defined(PERL_OBJECT) #else diff -ruN perl-5.6.0/embed.pl AP615_source/embed.pl --- perl-5.6.0/embed.pl Wed Jul 5 14:34:06 2000 +++ AP615_source/embed.pl Thu Jun 29 08:37:05 2000 @@ -1447,7 +1447,7 @@ Ap |void |dounwind |I32 cxix p |bool |do_aexec |SV* really|SV** mark|SV** sp p |bool |do_aexec5 |SV* really|SV** mark|SV** sp|int fd|int flag -Ap |int |do_binmode |PerlIO *fp|int iotype|int flag +Ap |int |do_binmode |PerlIO *fp|int iotype|int mode p |void |do_chop |SV* asv|SV* sv Ap |bool |do_close |GV* gv|bool not_implicit p |bool |do_eof |GV* gv @@ -1464,7 +1464,7 @@ p |I32 |do_semop |SV** mark|SV** sp p |I32 |do_shmio |I32 optype|SV** mark|SV** sp #endif -p |void |do_join |SV* sv|SV* del|SV** mark|SV** sp +Ap |void |do_join |SV* sv|SV* del|SV** mark|SV** sp p |OP* |do_kv Ap |bool |do_open |GV* gv|char* name|I32 len|int as_raw \ |int rawmode|int rawperm|PerlIO* supplied_fp @@ -1567,6 +1567,7 @@ Ap |char* |instr |const char* big|const char* little p |bool |io_close |IO* io|bool not_implicit p |OP* |invert |OP* cmd +dp |bool |is_gv_magical |char *name|STRLEN len|U32 flags Ap |bool |is_uni_alnum |U32 c Ap |bool |is_uni_alnumc |U32 c Ap |bool |is_uni_idfirst |U32 c @@ -1860,7 +1861,7 @@ Ap |void |repeatcpy |char* to|const char* from|I32 len|I32 count Ap |char* |rninstr |const char* big|const char* bigend \ |const char* little|const char* lend -p |Sighandler_t|rsignal |int i|Sighandler_t t +Ap |Sighandler_t|rsignal |int i|Sighandler_t t p |int |rsignal_restore|int i|Sigsave_t* t p |int |rsignal_save |int i|Sighandler_t t1|Sigsave_t* t2 p |Sighandler_t|rsignal_state|int i @@ -1885,6 +1886,7 @@ p |void |save_freeop |OP* o Ap |void |save_freepv |char* pv Ap |void |save_generic_svref|SV** sptr +Ap |void |save_generic_pvref|char** str Ap |void |save_gp |GV* gv|I32 empty Ap |HV* |save_hash |GV* gv Ap |void |save_helem |HV* hv|SV *key|SV **sptr @@ -2055,7 +2057,7 @@ Afp |void |warner |U32 err|const char* pat|... Ap |void |vwarner |U32 err|const char* pat|va_list* args p |void |watch |char** addr -p |I32 |whichsig |char* sig +Ap |I32 |whichsig |char* sig p |int |yyerror |char* s #if defined(USE_PURE_BISON) p |int |yylex |YYSTYPE *lvalp|int *lcharp @@ -2160,6 +2162,9 @@ Ap |void* |ptr_table_fetch|PTR_TBL_t *tbl|void *sv Ap |void |ptr_table_store|PTR_TBL_t *tbl|void *oldsv|void *newsv Ap |void |ptr_table_split|PTR_TBL_t *tbl +#endif +#if defined(HAVE_INTERP_INTERN) +Ap |void |sys_intern_init #endif #if defined(PERL_OBJECT) diff -ruN perl-5.6.0/embedvar.h AP615_source/embedvar.h --- perl-5.6.0/embedvar.h Wed Jul 5 14:34:07 2000 +++ AP615_source/embedvar.h Thu Jun 29 08:26:33 2000 @@ -322,6 +322,7 @@ #define PL_nomemok (PERL_GET_INTERP->Inomemok) #define PL_nthreads (PERL_GET_INTERP->Inthreads) #define PL_nthreads_cond (PERL_GET_INTERP->Inthreads_cond) +#define PL_nullstash (PERL_GET_INTERP->Inullstash) #define PL_numeric_local (PERL_GET_INTERP->Inumeric_local) #define PL_numeric_name (PERL_GET_INTERP->Inumeric_name) #define PL_numeric_radix (PERL_GET_INTERP->Inumeric_radix) @@ -586,6 +587,7 @@ #define PL_nomemok (vTHX->Inomemok) #define PL_nthreads (vTHX->Inthreads) #define PL_nthreads_cond (vTHX->Inthreads_cond) +#define PL_nullstash (vTHX->Inullstash) #define PL_numeric_local (vTHX->Inumeric_local) #define PL_numeric_name (vTHX->Inumeric_name) #define PL_numeric_radix (vTHX->Inumeric_radix) @@ -987,6 +989,7 @@ #define PL_nomemok (aTHXo->interp.Inomemok) #define PL_nthreads (aTHXo->interp.Inthreads) #define PL_nthreads_cond (aTHXo->interp.Inthreads_cond) +#define PL_nullstash (aTHXo->interp.Inullstash) #define PL_numeric_local (aTHXo->interp.Inumeric_local) #define PL_numeric_name (aTHXo->interp.Inumeric_name) #define PL_numeric_radix (aTHXo->interp.Inumeric_radix) @@ -1252,6 +1255,7 @@ #define PL_Inomemok PL_nomemok #define PL_Inthreads PL_nthreads #define PL_Inthreads_cond PL_nthreads_cond +#define PL_Inullstash PL_nullstash #define PL_Inumeric_local PL_numeric_local #define PL_Inumeric_name PL_numeric_name #define PL_Inumeric_radix PL_numeric_radix diff -ruN perl-5.6.0/ext/B/B/Deparse.pm AP615_source/ext/B/B/Deparse.pm --- perl-5.6.0/ext/B/B/Deparse.pm Wed Jul 5 14:34:08 2000 +++ AP615_source/ext/B/B/Deparse.pm Thu Jun 29 08:28:13 2000 @@ -1,5 +1,5 @@ # B::Deparse.pm -# Copyright (c) 1998, 1999 Stephen McCamant. All rights reserved. +# Copyright (c) 1998, 1999, 2000 Stephen McCamant. All rights reserved. # This module is free software; you can redistribute and/or modify # it under the same terms as Perl itself. @@ -8,7 +8,6 @@ package B::Deparse; use Carp 'cluck', 'croak'; -use Config; use B qw(class main_root main_start main_cv svref_2object opnumber OPf_WANT OPf_WANT_VOID OPf_WANT_SCALAR OPf_WANT_LIST OPf_KIDS OPf_REF OPf_STACKED OPf_SPECIAL @@ -17,7 +16,7 @@ SVf_IOK SVf_NOK SVf_ROK SVf_POK PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED); -$VERSION = 0.59; +$VERSION = 0.591; use strict; # Changes between 0.50 and 0.51: @@ -252,17 +251,17 @@ walk_tree($op, sub { my $op = shift; if ($op->name eq "gv") { - my $gv = $self->maybe_padgv($op); + my $gv = $self->gv_or_padgv($op); if ($op->next->name eq "entersub") { - next if $self->{'subs_done'}{$$gv}++; - next if class($gv->CV) eq "SPECIAL"; + return if $self->{'subs_done'}{$$gv}++; + return if class($gv->CV) eq "SPECIAL"; $self->todo($gv, $gv->CV, 0); $self->walk_sub($gv->CV); } elsif ($op->next->name eq "enterwrite" or ($op->next->name eq "rv2gv" and $op->next->next->name eq "enterwrite")) { - next if $self->{'forms_done'}{$$gv}++; - next if class($gv->FORM) eq "SPECIAL"; + return if $self->{'forms_done'}{$$gv}++; + return if class($gv->FORM) eq "SPECIAL"; $self->todo($gv, $gv->FORM, 1); $self->walk_sub($gv->FORM); } @@ -378,7 +377,7 @@ while (scalar(@{$self->{'subs_todo'}})) { push @text, $self->next_todo; } - print indent(join("", @text)), "\n" if @text; + print $self->indent(join("", @text)), "\n" if @text; } } @@ -1653,6 +1652,13 @@ } } +sub is_ifelse_cont { + my $op = shift; + return ($op->name eq "null" and class($op) eq "UNOP" + and $op->first->name =~ /^(and|cond_expr)$/ + and is_scope($op->first->first->sibling)); +} + sub pp_cond_expr { my $self = shift; my($op, $cx) = @_; @@ -1660,36 +1666,34 @@ my $true = $cond->sibling; my $false = $true->sibling; my $cuddle = $self->{'cuddle'}; - unless ($cx == 0 and is_scope($true) and is_scope($false)) { + unless ($cx == 0 and (is_scope($true) and $true->name ne "null") and + (is_scope($false) || is_ifelse_cont($false))) { $cond = $self->deparse($cond, 8); $true = $self->deparse($true, 8); $false = $self->deparse($false, 8); return $self->maybe_parens("$cond ? $true : $false", $cx, 8); - } + } + $cond = $self->deparse($cond, 1); $true = $self->deparse($true, 0); - if ($false->name eq "lineseq") { # braces w/o scope => elsif - my $head = "if ($cond) {\n\t$true\n\b}"; - my @elsifs; - while (!null($false) and $false->name eq "lineseq") { - my $newop = $false->first->sibling->first; - my $newcond = $newop->first; - my $newtrue = $newcond->sibling; - $false = $newtrue->sibling; # last in chain is OP_AND => no else - $newcond = $self->deparse($newcond, 1); - $newtrue = $self->deparse($newtrue, 0); - push @elsifs, "elsif ($newcond) {\n\t$newtrue\n\b}"; - } - if (!null($false)) { - $false = $cuddle . "else {\n\t" . - $self->deparse($false, 0) . "\n\b}\cK"; - } else { - $false = "\cK"; - } - return $head . join($cuddle, "", @elsifs) . $false; + my $head = "if ($cond) {\n\t$true\n\b}"; + my @elsifs; + while (!null($false) and is_ifelse_cont($false)) { + my $newop = $false->first; + my $newcond = $newop->first; + my $newtrue = $newcond->sibling; + $false = $newtrue->sibling; # last in chain is OP_AND => no else + $newcond = $self->deparse($newcond, 1); + $newtrue = $self->deparse($newtrue, 0); + push @elsifs, "elsif ($newcond) {\n\t$newtrue\n\b}"; + } + if (!null($false)) { + $false = $cuddle . "else {\n\t" . + $self->deparse($false, 0) . "\n\b}\cK"; + } else { + $false = "\cK"; } - $false = $self->deparse($false, 0); - return "if ($cond) {\n\t$true\n\b}${cuddle}else {\n\t$false\n\b}\cK"; + return $head . join($cuddle, "", @elsifs) . $false; } sub pp_leaveloop { @@ -1814,7 +1818,7 @@ } elsif ($op->first->name eq "enter") { return $self->pp_leave($op, $cx); } elsif ($op->targ == OP_STRINGIFY) { - return $self->dquote($op); + return $self->dquote($op, $cx); } elsif (!null($op->first->sibling) and $op->first->sibling->name eq "readline" and $op->first->sibling->flags & OPf_STACKED) { @@ -1879,37 +1883,34 @@ return $self->maybe_local($op, $cx, "\$" . $threadsv_names[$op->targ]); } -sub maybe_padgv { +sub gv_or_padgv { my $self = shift; my $op = shift; - my $gv; - if ($Config{useithreads}) { - $gv = $self->padval($op->padix); + if (class($op) eq "PADOP") { + return $self->padval($op->padix); + } else { # class($op) eq "SVOP" + return $op->gv; } - else { - $gv = $op->gv; - } - return $gv; } sub pp_gvsv { my $self = shift; my($op, $cx) = @_; - my $gv = $self->maybe_padgv($op); + my $gv = $self->gv_or_padgv($op); return $self->maybe_local($op, $cx, "\$" . $self->gv_name($gv)); } sub pp_gv { my $self = shift; my($op, $cx) = @_; - my $gv = $self->maybe_padgv($op); + my $gv = $self->gv_or_padgv($op); return $self->gv_name($gv); } sub pp_aelemfast { my $self = shift; my($op, $cx) = @_; - my $gv = $self->maybe_padgv($op); + my $gv = $self->gv_or_padgv($op); return "\$" . $self->gv_name($gv) . "[" . $op->private . "]"; } @@ -2220,7 +2221,7 @@ $amper = "&"; $kid = "{" . $self->deparse($kid, 0) . "}"; } elsif ($kid->first->name eq "gv") { - my $gv = $self->maybe_padgv($kid->first); + my $gv = $self->gv_or_padgv($kid->first); if (class($gv->CV) ne "SPECIAL") { $proto = $gv->CV->PV if $gv->CV->FLAGS & SVf_POK; } @@ -2252,9 +2253,9 @@ } else { if (defined $proto and $proto eq "") { return $kid; - } elsif ($proto eq "\$") { + } elsif (defined $proto and $proto eq "\$") { return $self->maybe_parens_func($kid, $args, $cx, 16); - } elsif ($proto or $simple) { + } elsif (defined($proto) && $proto or $simple) { return $self->maybe_parens_func($kid, $args, $cx, 5); } else { return "$kid(" . $args . ")"; @@ -2418,7 +2419,7 @@ sub dquote { my $self = shift; - my($op, $cx) = shift; + my($op, $cx) = @_; my $kid = $op->first->sibling; # skip ex-stringify, pushmark return $self->deparse($kid, $cx) if $self->{'unquote'}; $self->maybe_targmy($kid, $cx, diff -ruN perl-5.6.0/ext/Data/Dumper/Dumper.xs AP615_source/ext/Data/Dumper/Dumper.xs --- perl-5.6.0/ext/Data/Dumper/Dumper.xs Wed Jul 5 14:34:09 2000 +++ AP615_source/ext/Data/Dumper/Dumper.xs Thu Jun 29 08:28:46 2000 @@ -584,8 +584,7 @@ if (SvIOK(val)) { STRLEN len; - i = SvIV(val); - (void) sprintf(tmpbuf, "%"IVdf, (IV)i); + (void) sprintf(tmpbuf, "%"IVdf, SvIV(val)); len = strlen(tmpbuf); sv_catpvn(retval, tmpbuf, len); } diff -ruN perl-5.6.0/ext/File/Glob/Glob.pm AP615_source/ext/File/Glob/Glob.pm --- perl-5.6.0/ext/File/Glob/Glob.pm Wed Jul 5 14:34:09 2000 +++ AP615_source/ext/File/Glob/Glob.pm Thu Jun 29 08:30:30 2000 @@ -11,8 +11,12 @@ @ISA = qw(Exporter AutoLoader); +# NOTE: The glob() export is only here for compatibility with 5.6.0. +# csh_glob() should not be used directly, unless you know what you're doing. + @EXPORT_OK = qw( csh_glob + bsd_glob glob GLOB_ABEND GLOB_ALTDIRFUNC @@ -47,6 +51,7 @@ GLOB_QUOTE GLOB_TILDE glob + bsd_glob ) ], ); @@ -108,12 +113,18 @@ # Autoload methods go after =cut, and are processed by the autosplit program. -sub glob { +sub bsd_glob { my ($pat,$flags) = @_; $flags = $DEFAULT_FLAGS if @_ < 2; return doglob($pat,$flags); } +# File::Glob::glob() is deprecated because its prototype is different from +# CORE::glob() (use bsd_glob() instead) +sub glob { + goto &bsd_glob; +} + ## borrowed heavily from gsar's File::DosGlob my %iter; my %entries; @@ -177,13 +188,13 @@ =head1 SYNOPSIS use File::Glob ':glob'; - @list = glob('*.[ch]'); - $homedir = glob('~gnat', GLOB_TILDE | GLOB_ERR); + @list = bsd_glob('*.[ch]'); + $homedir = bsd_glob('~gnat', GLOB_TILDE | GLOB_ERR); if (GLOB_ERROR) { # an error occurred reading $homedir } - ## override the core glob (core glob() does this automatically + ## override the core glob (CORE::glob() does this automatically ## by default anyway, since v5.6.0) use File::Glob ':globally'; my @sources = <*.{c,h,y}> @@ -198,19 +209,27 @@ =head1 DESCRIPTION -File::Glob implements the FreeBSD glob(3) routine, which is a superset -of the POSIX glob() (described in IEEE Std 1003.2 "POSIX.2"). The -glob() routine takes a mandatory C argument, and an optional +File::Glob::bsd_glob() implements the FreeBSD glob(3) routine, which is +a superset of the POSIX glob() (described in IEEE Std 1003.2 "POSIX.2"). +bsd_glob() takes a mandatory C argument, and an optional C argument, and returns a list of filenames matching the pattern, with interpretation of the pattern modified by the C -variable. The POSIX defined flags are: +variable. + +Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob(). +Note that they don't share the same prototype--CORE::glob() only accepts +a single argument. Due to historical reasons, CORE::glob() will also +split its argument on whitespace, treating it as multiple patterns, +whereas bsd_glob() considers them as one pattern. + +The POSIX defined flags for bsd_glob() are: =over 4 =item C -Force glob() to return an error when it encounters a directory it -cannot open or read. Ordinarily glob() continues to find matches. +Force bsd_glob() to return an error when it encounters a directory it +cannot open or read. Ordinarily bsd_glob() continues to find matches. =item C @@ -220,18 +239,18 @@ =item C By default, file names are assumed to be case sensitive; this flag -makes glob() treat case differences as not significant. +makes bsd_glob() treat case differences as not significant. =item C -If the pattern does not match any pathname, then glob() returns a list +If the pattern does not match any pathname, then bsd_glob() returns a list consisting of only the pattern. If C is set, its effect is present in the pattern returned. =item C By default, the pathnames are sorted in ascending ASCII order; this -flag prevents that sorting (speeding up glob()). +flag prevents that sorting (speeding up bsd_glob()). =back @@ -277,7 +296,7 @@ =head1 DIAGNOSTICS -glob() returns a list of matching paths, possibly zero length. If an +bsd_glob() returns a list of matching paths, possibly zero length. If an error occurred, &File::Glob::GLOB_ERROR will be non-zero and C<$!> will be set. &File::Glob::GLOB_ERROR is guaranteed to be zero if no error occurred, or one of the following values otherwise: @@ -294,12 +313,12 @@ =back -In the case where glob() has found some matching paths, but is -interrupted by an error, glob() will return a list of filenames B +In the case where bsd_glob() has found some matching paths, but is +interrupted by an error, it will return a list of filenames B set &File::Glob::ERROR. -Note that glob() deviates from POSIX and FreeBSD glob(3) behaviour by -not considering C and C as errors - glob() will +Note that bsd_glob() deviates from POSIX and FreeBSD glob(3) behaviour +by not considering C and C as errors - bsd_glob() will continue processing despite those errors, unless the C flag is set. @@ -311,10 +330,10 @@ =item * -If you want to use multiple patterns, e.g. C, you should -probably throw them in a set as in C. This is because -the argument to glob isn't subjected to parsing by the C shell. Remember -that you can use a backslash to escape things. +If you want to use multiple patterns, e.g. C, you should +probably throw them in a set as in C. This is because +the argument to bsd_glob() isn't subjected to parsing by the C shell. +Remember that you can use a backslash to escape things. =item * diff -ruN perl-5.6.0/ext/IO/lib/IO/Poll.pm AP615_source/ext/IO/lib/IO/Poll.pm --- perl-5.6.0/ext/IO/lib/IO/Poll.pm Wed Jul 5 14:34:10 2000 +++ AP615_source/ext/IO/lib/IO/Poll.pm Thu Jun 29 08:30:23 2000 @@ -1,3 +1,4 @@ + # IO::Poll.pm # # Copyright (c) 1997-8 Graham Barr . All rights reserved. @@ -12,28 +13,31 @@ our(@ISA, @EXPORT_OK, @EXPORT, $VERSION); @ISA = qw(Exporter); -$VERSION = "0.01"; +$VERSION = "0.05"; -@EXPORT = qw(poll); +@EXPORT = qw( POLLIN + POLLOUT + POLLERR + POLLHUP + POLLNVAL + ); @EXPORT_OK = qw( - POLLIN POLLPRI - POLLOUT POLLRDNORM POLLWRNORM POLLRDBAND POLLWRBAND POLLNORM - POLLERR - POLLHUP - POLLNVAL -); + ); +# [0] maps fd's to requested masks +# [1] maps fd's to returned masks +# [2] maps fd's to handles sub new { my $class = shift; - my $self = bless [{},{}], $class; + my $self = bless [{},{},{}], $class; $self; } @@ -42,20 +46,21 @@ my $self = shift; my $io = shift; my $fd = fileno($io); - if(@_) { + if (@_) { my $mask = shift; - $self->[0]{$fd} ||= {}; if($mask) { - $self->[0]{$fd}{$io} = $mask; - } - else { + $self->[0]{$fd}{$io} = $mask; # the error events are always returned + $self->[1]{$fd} = 0; # output mask + $self->[2]{$io} = $io; # remember handle + } else { delete $self->[0]{$fd}{$io}; + delete $self->[1]{$fd} unless %{$self->[0]{$fd}}; + delete $self->[2]{$io}; } } - elsif(exists $self->[0]{$fd}{$io}) { + + return unless exists $self->[0]{$fd} and exists $self->[0]{$fd}{$io}; return $self->[0]{$fd}{$io}; - } - return; } @@ -64,13 +69,13 @@ $self->[1] = {}; - my($fd,$ref); + my($fd,$mask,$iom); my @poll = (); - while(($fd,$ref) = each %{$self->[0]}) { - my $events = 0; - map { $events |= $_ } values %{$ref}; - push(@poll,$fd, $events); + while(($fd,$iom) = each %{$self->[0]}) { + $mask = 0; + $mask |= $_ for values(%$iom); + push(@poll,$fd => $mask); } my $ret = @poll ? _poll(defined($timeout) ? $timeout * 1000 : -1,@poll) : 0; @@ -80,8 +85,7 @@ while(@poll) { my($fd,$got) = splice(@poll,0,2); - $self->[1]{$fd} = $got - if $got; + $self->[1]{$fd} = $got if $got; } return $ret; @@ -91,9 +95,8 @@ my $self = shift; my $io = shift; my $fd = fileno($io); - - exists $self->[1]{$fd} && exists $self->[0]{$fd}{$io} - ? $self->[1]{$fd} & $self->[0]{$fd}{$io} + exists $self->[1]{$fd} and exists $self->[0]{$fd}{$io} + ? $self->[1]{$fd} & ($self->[0]{$fd}{$io}|POLLHUP|POLLERR|POLLNVAL) : 0; } @@ -105,20 +108,16 @@ sub handles { my $self = shift; - - return map { keys %$_ } values %{$self->[0]} - unless(@_); + return values %{$self->[2]} unless @_; my $events = shift || 0; my($fd,$ev,$io,$mask); my @handles = (); while(($fd,$ev) = each %{$self->[1]}) { - if($ev & $events) { - while(($io,$mask) = each %{$self->[0][$fd]}) { - push(@handles, $io) - if $events & $mask; - } + while (($io,$mask) = each %{$self->[0]{$fd}}) { + $mask |= POLLHUP|POLLERR|POLLNVAL; # must allow these + push @handles,$self->[2]{$io} if ($ev & $mask) & $events; } } return @handles; @@ -138,8 +137,8 @@ $poll = new IO::Poll; - $poll->mask($input_handle => POLLRDNORM | POLLIN | POLLHUP); - $poll->mask($output_handle => POLLWRNORM); + $poll->mask($input_handle => POLLIN); + $poll->mask($output_handle => POLLOUT); $poll->poll($timeout); diff -ruN perl-5.6.0/ext/IO/lib/IO/Socket/INET.pm AP615_source/ext/IO/lib/IO/Socket/INET.pm --- perl-5.6.0/ext/IO/lib/IO/Socket/INET.pm Wed Jul 5 14:34:10 2000 +++ AP615_source/ext/IO/lib/IO/Socket/INET.pm Thu Jun 29 08:29:20 2000 @@ -34,6 +34,7 @@ sub _sock_info { my($addr,$port,$proto) = @_; + my $origport = $port; my @proto = (); my @serv = (); @@ -59,14 +60,14 @@ my $defport = $1 || undef; my $pnum = ($port =~ m,^(\d+)$,)[0]; - if ($port =~ m,\D,) { - unless (@serv = getservbyname($port, $proto[0] || "")) { - $@ = "Bad service '$port'"; - return; - } - } + @serv = getservbyname($port, $proto[0] || "") + if ($port =~ m,\D,); $port = $pnum || $serv[2] || $defport || undef; + unless (defined $port) { + $@ = "Bad service '$origport'"; + return; + } $proto = (getprotobyname($serv[3]))[2] || undef if @serv && !$proto; diff -ruN perl-5.6.0/ext/POSIX/POSIX.pm AP615_source/ext/POSIX/POSIX.pm --- perl-5.6.0/ext/POSIX/POSIX.pm Wed Jul 5 14:34:10 2000 +++ AP615_source/ext/POSIX/POSIX.pm Thu Jun 29 08:33:22 2000 @@ -565,9 +565,9 @@ sub fstat { usage "fstat(fd)" if @_ != 1; local *TMP; - open(TMP, "<&$_[0]"); # Gross. + CORE::open(TMP, "<&$_[0]"); # Gross. my @l = CORE::stat(TMP); - close(TMP); + CORE::close(TMP); @l; } diff -ruN perl-5.6.0/ext/Sys/Syslog/Syslog.pm AP615_source/ext/Sys/Syslog/Syslog.pm --- perl-5.6.0/ext/Sys/Syslog/Syslog.pm Wed Jul 5 14:34:11 2000 +++ AP615_source/ext/Sys/Syslog/Syslog.pm Thu Jun 29 08:30:30 2000 @@ -70,9 +70,11 @@ C or C and returns TRUE on success, undef on failure. -A value of 'unix' will connect to the UNIX domain socket returned by -C<_PATH_LOG> in F. A value of 'inet' will connect to an -INET socket returned by getservbyname(). Any other value croaks. +A value of 'unix' will connect to the UNIX domain socket returned by the +C<_PATH_LOG> macro (if you system defines it) in F. A value of +'inet' will connect to an INET socket returned by getservbyname(). If +C<_PATH_LOG> is unavailable or if getservbyname() fails, returns undef. Any +other value croaks. The default is for the INET socket to be used. @@ -107,10 +109,15 @@ =head1 AUTHOR -Tom Christiansen EFE and Larry Wall EFE. -UNIX domain sockets added by Sean Robinson EFE -with support from Tim Bunce and the perl5-porters mailing list. -Dependency on F replaced with XS code bu Tom Hughes EFE. +Tom Christiansen EFE and Larry Wall +EFE. + +UNIX domain sockets added by Sean Robinson +EFE with support from Tim Bunce +EFE and the perl5-porters mailing list. + +Dependency on F replaced with XS code by Tom Hughes +EFE. =cut @@ -159,7 +166,7 @@ local($setsock) = shift; &disconnect if $connected; if (lc($setsock) eq 'unix') { - if (defined &_PATH_LOG) { + if (length _PATH_LOG()) { $sock_type = 1; } else { return undef; @@ -244,9 +251,9 @@ else { if (open(CONS,">/dev/console")) { print CONS "<$facility.$priority>$whoami: $message\r"; - exit if defined $pid; # if fork failed, we're parent close CONS; } + exit if defined $pid; # if fork failed, we're parent } } } @@ -274,7 +281,8 @@ socket(SYSLOG,AF_INET,SOCK_DGRAM,$udp) || croak "socket: $!"; connect(SYSLOG,$that) || croak "connect: $!"; } else { - my $syslog = &_PATH_LOG || croak "_PATH_LOG not found in syslog.ph"; + my $syslog = _PATH_LOG(); + length($syslog) || croak "_PATH_LOG unavailable in syslog.h"; my $that = sockaddr_un($syslog) || croak "Can't locate $syslog"; socket(SYSLOG,AF_UNIX,SOCK_STREAM,0) || croak "socket: $!"; if (!connect(SYSLOG,$that)) { diff -ruN perl-5.6.0/ext/Sys/Syslog/Syslog.xs AP615_source/ext/Sys/Syslog/Syslog.xs --- perl-5.6.0/ext/Sys/Syslog/Syslog.xs Wed Jul 5 14:34:11 2000 +++ AP615_source/ext/Sys/Syslog/Syslog.xs Thu Jun 29 08:30:30 2000 @@ -550,8 +550,7 @@ #ifdef _PATH_LOG RETVAL = _PATH_LOG; #else - croak("Your vendor has not defined the Sys::Syslog macro _PATH_LOG"); - RETVAL = NULL; + RETVAL = ""; #endif OUTPUT: RETVAL diff -ruN perl-5.6.0/global.sym AP615_source/global.sym --- perl-5.6.0/global.sym Wed Jul 5 14:34:12 2000 +++ AP615_source/global.sym Thu Jun 29 08:32:49 2000 @@ -88,6 +88,7 @@ Perl_dounwind Perl_do_binmode Perl_do_close +Perl_do_join Perl_do_open Perl_do_open9 Perl_dowantarray @@ -320,6 +321,7 @@ Perl_regnext Perl_repeatcpy Perl_rninstr +Perl_rsignal Perl_savepv Perl_savepvn Perl_savestack_grow @@ -463,6 +465,7 @@ Perl_vwarn Perl_warner Perl_vwarner +Perl_whichsig Perl_dump_mstats Perl_get_mstats Perl_safesysmalloc @@ -537,3 +540,4 @@ Perl_ptr_table_fetch Perl_ptr_table_store Perl_ptr_table_split +Perl_sys_intern_init diff -ruN perl-5.6.0/gv.c AP615_source/gv.c --- perl-5.6.0/gv.c Wed Jul 5 14:34:12 2000 +++ AP615_source/gv.c Thu Jun 29 08:33:12 2000 @@ -520,7 +520,6 @@ I32 len; register const char *namend; HV *stash = 0; - U32 add_gvflags = 0; if (*name == '*' && isALPHA(name[1])) /* accidental stringify on a GV? */ name++; @@ -653,8 +652,10 @@ : sv_type == SVt_PVAV ? "@" : sv_type == SVt_PVHV ? "%" : ""), name)); + stash = PL_nullstash; } - return Nullgv; + else + return Nullgv; } if (!SvREFCNT(stash)) /* symbol table under destruction */ @@ -680,7 +681,6 @@ Perl_warner(aTHX_ WARN_INTERNAL, "Had to create %s unexpectedly", nambeg); gv_init(gv, stash, name, len, add & GV_ADDMULTI); gv_init_sv(gv, sv_type); - GvFLAGS(gv) |= add_gvflags; if (isLEXWARN_on && isALPHA(name[0]) && ! ckWARN(WARN_ONCE)) GvMULTI_on(gv) ; @@ -1579,4 +1579,111 @@ return res; } } +} + +/* +=for apidoc is_gv_magical + +Returns C if given the name of a magical GV. + +Currently only useful internally when determining if a GV should be +created even in rvalue contexts. + +C is not used at present but available for future extension to +allow selecting particular classes of magical variable. + +=cut +*/ +bool +Perl_is_gv_magical(pTHX_ char *name, STRLEN len, U32 flags) +{ + if (!len) + return FALSE; + + switch (*name) { + case 'I': + if (len == 3 && strEQ(name, "ISA")) + goto yes; + break; + case 'O': + if (len == 8 && strEQ(name, "OVERLOAD")) + goto yes; + break; + case 'S': + if (len == 3 && strEQ(name, "SIG")) + goto yes; + break; + case '\027': /* $^W & $^WARNING_BITS */ + if (len == 1 + || (len == 12 && strEQ(name, "\027ARNING_BITS")) + || (len == 17 && strEQ(name, "\027IDE_SYSTEM_CALLS"))) + { + goto yes; + } + break; + + case '&': + case '`': + case '\'': + case ':': + case '?': + case '!': + case '-': + case '#': + case '*': + case '[': + case '^': + case '~': + case '=': + case '%': + case '.': + case '(': + case ')': + case '<': + case '>': + case ',': + case '\\': + case '/': + case '|': + case '+': + case ';': + case ']': + case '\001': /* $^A */ + case '\003': /* $^C */ + case '\004': /* $^D */ + case '\005': /* $^E */ + case '\006': /* $^F */ + case '\010': /* $^H */ + case '\011': /* $^I, NOT \t in EBCDIC */ + case '\014': /* $^L */ + case '\017': /* $^O */ + case '\020': /* $^P */ + case '\023': /* $^S */ + case '\024': /* $^T */ + case '\026': /* $^V */ + if (len == 1) + goto yes; + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (len > 1) { + char *end = name + len; + while (--end > name) { + if (!isDIGIT(*end)) + return FALSE; + } + } + yes: + return TRUE; + default: + break; + } + return FALSE; } diff -ruN perl-5.6.0/intrpvar.h AP615_source/intrpvar.h --- perl-5.6.0/intrpvar.h Wed Jul 5 14:34:13 2000 +++ AP615_source/intrpvar.h Thu Jun 29 08:26:33 2000 @@ -443,3 +443,5 @@ #if defined(USE_ITHREADS) PERLVAR(Iptr_table, PTR_TBL_t*) #endif + +PERLVAR(Inullstash, HV *) /* illegal symbols end up here */ diff -ruN perl-5.6.0/lib/Carp/Heavy.pm AP615_source/lib/Carp/Heavy.pm --- perl-5.6.0/lib/Carp/Heavy.pm Wed Jul 5 14:34:15 2000 +++ AP615_source/lib/Carp/Heavy.pm Thu Jun 29 08:32:15 2000 @@ -42,7 +42,7 @@ # # if the $error error string is newline terminated then it # is copied into $mess. Otherwise, $mess gets set (at the end of - # the 'else {' section below) to one of two things. The first time + # the 'else' section below) to one of two things. The first time # through, it is set to the "$error at $file line $line" message. # $error is then set to 'called' which triggers subsequent loop # iterations to append $sub to $mess before appending the "$error @@ -121,10 +121,7 @@ # $line" makes sense as "called at $file line $line". $error = "called"; } - # this kludge circumvents die's incorrect handling of NUL - my $msg = \($mess || $error); - $$msg =~ tr/\0//d; - $$msg; + $mess || $error; } @@ -227,9 +224,7 @@ } else { # OK! We've got a candidate package. Time to construct the - # relevant error message and return it. die() doesn't like - # to be given NUL characters (which $msg may contain) so we - # remove them first. + # relevant error message and return it. my $msg; $msg = "$error at $file line $line"; if (defined &Thread::tid) { @@ -237,7 +232,6 @@ $mess .= " thread $tid" if $tid; } $msg .= "\n"; - $msg =~ tr/\0//d; return $msg; } } diff -ruN perl-5.6.0/lib/English.pm AP615_source/lib/English.pm --- perl-5.6.0/lib/English.pm Wed Jul 5 14:34:15 2000 +++ AP615_source/lib/English.pm Thu Jun 29 08:31:31 2000 @@ -98,6 +98,8 @@ *OSNAME *LAST_REGEXP_CODE_RESULT *EXCEPTIONS_BEING_CAUGHT + @LAST_MATCH_START + @LAST_MATCH_END ); # The ground of all being. @ARG is deprecated (5.005 makes @_ lexical) @@ -110,6 +112,8 @@ *PREMATCH = *` ; *POSTMATCH = *' ; *LAST_PAREN_MATCH = *+ ; + *LAST_MATCH_START = *-{ARRAY} ; + *LAST_MATCH_END = *+{ARRAY} ; # Input. diff -ruN perl-5.6.0/lib/ExtUtils/Liblist.pm AP615_source/lib/ExtUtils/Liblist.pm --- perl-5.6.0/lib/ExtUtils/Liblist.pm Wed Jul 5 14:34:16 2000 +++ AP615_source/lib/ExtUtils/Liblist.pm Thu Jun 29 08:29:44 2000 @@ -230,6 +230,10 @@ # add "$Config{installarchlib}/CORE" to default search path push @libpath, "$Config{installarchlib}/CORE"; + if ($VC and exists $ENV{LIB} and $ENV{LIB}) { + push @libpath, split /;/, $ENV{LIB}; + } + foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)){ $thislib = $_; diff -ruN perl-5.6.0/lib/ExtUtils/MM_Unix.pm AP615_source/lib/ExtUtils/MM_Unix.pm --- perl-5.6.0/lib/ExtUtils/MM_Unix.pm Wed Jul 5 14:34:16 2000 +++ AP615_source/lib/ExtUtils/MM_Unix.pm Thu Jun 29 08:36:08 2000 @@ -1249,11 +1249,6 @@ next; } my($dev,$ino,$mode) = stat FIXIN; - # If they override perm_rwx, we won't notice it during fixin, - # because fixin is run through a new instance of MakeMaker. - # That is why we must run another CHMOD later. - $mode = oct($self->perm_rwx) unless $dev; - chmod $mode, $file; # Print out the new #! line (or equivalent). local $\; @@ -1261,7 +1256,15 @@ print FIXOUT $shb, ; close FIXIN; close FIXOUT; - # can't rename open files on some DOSISH platforms + + # can't rename/chmod open files on some DOSISH platforms + + # If they override perm_rwx, we won't notice it during fixin, + # because fixin is run through a new instance of MakeMaker. + # That is why we must run another CHMOD later. + $mode = oct($self->perm_rwx) unless $dev; + chmod $mode, $file; + unless ( rename($file, "$file.bak") ) { warn "Can't rename $file to $file.bak: $!"; next; @@ -1276,6 +1279,7 @@ } unlink "$file.bak"; } continue { + close(FIXIN) if fileno(FIXIN); chmod oct($self->perm_rwx), $file or die "Can't reset permissions for $file: $!\n"; system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';; diff -ruN perl-5.6.0/lib/ExtUtils/MakeMaker.pm AP615_source/lib/ExtUtils/MakeMaker.pm --- perl-5.6.0/lib/ExtUtils/MakeMaker.pm Wed Jul 5 14:34:17 2000 +++ AP615_source/lib/ExtUtils/MakeMaker.pm Thu Jun 29 08:29:31 2000 @@ -189,7 +189,7 @@ AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE FULLPERL FUNCLIST H - HTMLLIBPODS HTMLSCRIPTPOD IMPORTS + HTMLLIBPODS HTMLSCRIPTPODS IMPORTS INC INCLUDE_EXT INSTALLARCHLIB INSTALLBIN INSTALLDIRS INSTALLHTMLPRIVLIBDIR INSTALLHTMLSCRIPTDIR INSTALLHTMLSITELIBDIR INSTALLMAN1DIR INSTALLMAN3DIR INSTALLPRIVLIB INSTALLSCRIPT INSTALLSITEARCH diff -ruN perl-5.6.0/lib/File/Find.pm AP615_source/lib/File/Find.pm --- perl-5.6.0/lib/File/Find.pm Wed Jul 5 14:34:17 2000 +++ AP615_source/lib/File/Find.pm Thu Jun 29 08:36:38 2000 @@ -584,12 +584,24 @@ while (defined $SE) { unless ($bydepth) { + # change to parent directory + unless ($no_chdir) { + my $udir = $pdir_loc; + if ($untaint) { + $udir = $1 if $pdir_loc =~ m|$untaint_pat|; + } + unless (chdir $udir) { + warn "Can't cd to $udir: $!\n"; + next; + } + } $dir= $p_dir; $name= $dir_name; $_= ($no_chdir ? $dir_name : $dir_rel ); $fullname= $dir_loc; # prune may happen here $prune= 0; + lstat($_); # make sure file tests with '_' work &$wanted_callback; next if $prune; } @@ -673,6 +685,7 @@ s|/\.$||; } + lstat($_); # make sure file tests with '_' work &$wanted_callback; } else { push @Stack,[$dir_loc, $pdir_loc, $p_dir, $dir_rel,-1] if $bydepth; diff -ruN perl-5.6.0/lib/Math/Complex.pm AP615_source/lib/Math/Complex.pm --- perl-5.6.0/lib/Math/Complex.pm Wed Jul 5 14:34:18 2000 +++ AP615_source/lib/Math/Complex.pm Thu Jun 29 08:28:56 2000 @@ -1373,7 +1373,6 @@ 1; __END__ -=pod =head1 NAME Math::Complex - complex numbers and associated mathematical functions diff -ruN perl-5.6.0/lib/perl5db.pl AP615_source/lib/perl5db.pl --- perl-5.6.0/lib/perl5db.pl Wed Jul 5 14:34:20 2000 +++ AP615_source/lib/perl5db.pl Thu Jun 29 09:01:50 2000 @@ -980,18 +980,18 @@ next CMD; }; $cmd =~ /^<\s*(.*)/ && do { unless ($1) { - print OUT "All < actions cleared.\n"; + print $OUT "All < actions cleared.\n"; $pre = []; next CMD; } if ($1 eq '?') { unless (@$pre) { - print OUT "No pre-prompt Perl actions.\n"; + print $OUT "No pre-prompt Perl actions.\n"; next CMD; } - print OUT "Perl commands run before each prompt:\n"; + print $OUT "Perl commands run before each prompt:\n"; for my $action ( @$pre ) { - print "\t< -- $action\n"; + print $OUT "\t< -- $action\n"; } next CMD; } @@ -999,18 +999,18 @@ next CMD; }; $cmd =~ /^>\s*(.*)/ && do { unless ($1) { - print OUT "All > actions cleared.\n"; + print $OUT "All > actions cleared.\n"; $post = []; next CMD; } if ($1 eq '?') { unless (@$post) { - print OUT "No post-prompt Perl actions.\n"; + print $OUT "No post-prompt Perl actions.\n"; next CMD; } - print OUT "Perl commands run after each prompt:\n"; + print $OUT "Perl commands run after each prompt:\n"; for my $action ( @$post ) { - print "\t> -- $action\n"; + print $OUT "\t> -- $action\n"; } next CMD; } @@ -1018,7 +1018,7 @@ next CMD; }; $cmd =~ /^\{\{\s*(.*)/ && do { if ($cmd =~ /^\{.*\}$/ && unbalanced(substr($cmd,2))) { - print OUT "{{ is now a debugger command\n", + print $OUT "{{ is now a debugger command\n", "use `;{{' if you mean Perl code\n"; $cmd = "h {{"; redo CMD; @@ -1027,23 +1027,23 @@ next CMD; }; $cmd =~ /^\{\s*(.*)/ && do { unless ($1) { - print OUT "All { actions cleared.\n"; + print $OUT "All { actions cleared.\n"; $pretype = []; next CMD; } if ($1 eq '?') { unless (@$pretype) { - print OUT "No pre-prompt debugger actions.\n"; + print $OUT "No pre-prompt debugger actions.\n"; next CMD; } - print OUT "Debugger commands run before each prompt:\n"; + print $OUT "Debugger commands run before each prompt:\n"; for my $action ( @$pretype ) { - print "\t{ -- $action\n"; + print $OUT "\t{ -- $action\n"; } next CMD; } if ($cmd =~ /^\{.*\}$/ && unbalanced(substr($cmd,1))) { - print OUT "{ is now a debugger command\n", + print $OUT "{ is now a debugger command\n", "use `;{' if you mean Perl code\n"; $cmd = "h {"; redo CMD; @@ -1815,7 +1815,7 @@ local $frame = 0; local $doret = -2; if (ref $OUT and UNIVERSAL::isa($OUT, 'IO::Socket::INET')) { - print $OUT @_; + $OUT->write(join('', @_)); my $stuff; $IN->recv( $stuff, 2048 ); # XXX: what's wrong with sysread? $stuff; diff -ruN perl-5.6.0/lib/vars.pm AP615_source/lib/vars.pm --- perl-5.6.0/lib/vars.pm Wed Jul 5 14:34:28 2000 +++ AP615_source/lib/vars.pm Thu Jun 29 08:28:18 2000 @@ -8,7 +8,8 @@ # if Carp hasn't been loaded in earlier compile time. :-( # We'll let those bugs get found on the development track. require Carp if $] < 5.00450; -use warnings::register(); + +use warnings::register; sub import { my $callpack = caller; diff -ruN perl-5.6.0/makedef.pl AP615_source/makedef.pl --- perl-5.6.0/makedef.pl Wed Jul 5 14:34:28 2000 +++ AP615_source/makedef.pl Thu Jun 29 08:32:49 2000 @@ -260,6 +260,7 @@ Perl_same_dirent Perl_unlnk Perl_sys_intern_dup + Perl_sys_intern_init PL_cryptseen PL_opsave PL_statusvalue_vms diff -ruN perl-5.6.0/mg.c AP615_source/mg.c --- perl-5.6.0/mg.c Wed Jul 5 14:34:28 2000 +++ AP615_source/mg.c Thu Jun 29 08:32:56 2000 @@ -1735,7 +1735,7 @@ PL_compiling.cop_warnings = pWARN_NONE; break; } - if (isWARN_on(sv, WARN_ALL)) { + if (isWARN_on(sv, WARN_ALL) && !isWARNf_on(sv, WARN_ALL)) { PL_compiling.cop_warnings = pWARN_ALL; PL_dowarn |= G_WARN_ONCE ; } @@ -2100,7 +2100,11 @@ Signal_t Perl_sighandler(int sig) { +#if defined(WIN32) && defined(PERL_IMPLICIT_CONTEXT) + dTHXoa(PL_curinterp); /* fake TLS, because signals don't do TLS */ +#else dTHX; +#endif dSP; GV *gv = Nullgv; HV *st; @@ -2110,6 +2114,10 @@ U32 flags = 0; I32 o_save_i = PL_savestack_ix; XPV *tXpv = PL_Xpv; + +#if defined(WIN32) && defined(PERL_IMPLICIT_CONTEXT) + PERL_SET_THX(aTHXo); /* fake TLS, see above */ +#endif if (PL_savestack_ix + 15 <= PL_savestack_max) flags |= 1; diff -ruN perl-5.6.0/objXSUB.h AP615_source/objXSUB.h --- perl-5.6.0/objXSUB.h Wed Jul 5 14:34:29 2000 +++ AP615_source/objXSUB.h Thu Jun 29 08:37:05 2000 @@ -313,6 +313,10 @@ #endif #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #endif +#undef Perl_do_join +#define Perl_do_join pPerl->Perl_do_join +#undef do_join +#define do_join Perl_do_join #undef Perl_do_open #define Perl_do_open pPerl->Perl_do_open #undef do_open @@ -1279,6 +1283,10 @@ #define Perl_rninstr pPerl->Perl_rninstr #undef rninstr #define rninstr Perl_rninstr +#undef Perl_rsignal +#define Perl_rsignal pPerl->Perl_rsignal +#undef rsignal +#define rsignal Perl_rsignal #if !defined(HAS_RENAME) #endif #undef Perl_savepv @@ -1337,6 +1345,10 @@ #define Perl_save_generic_svref pPerl->Perl_save_generic_svref #undef save_generic_svref #define save_generic_svref Perl_save_generic_svref +#undef Perl_save_generic_pvref +#define Perl_save_generic_pvref pPerl->Perl_save_generic_pvref +#undef save_generic_pvref +#define save_generic_pvref Perl_save_generic_pvref #undef Perl_save_gp #define Perl_save_gp pPerl->Perl_save_gp #undef save_gp @@ -1861,6 +1873,10 @@ #define Perl_vwarner pPerl->Perl_vwarner #undef vwarner #define vwarner Perl_vwarner +#undef Perl_whichsig +#define Perl_whichsig pPerl->Perl_whichsig +#undef whichsig +#define whichsig Perl_whichsig #if defined(USE_PURE_BISON) #else #endif @@ -2171,6 +2187,12 @@ #define Perl_ptr_table_split pPerl->Perl_ptr_table_split #undef ptr_table_split #define ptr_table_split Perl_ptr_table_split +#endif +#if defined(HAVE_INTERP_INTERN) +#undef Perl_sys_intern_init +#define Perl_sys_intern_init pPerl->Perl_sys_intern_init +#undef sys_intern_init +#define sys_intern_init Perl_sys_intern_init #endif #if defined(PERL_OBJECT) #else diff -ruN perl-5.6.0/op.c AP615_source/op.c --- perl-5.6.0/op.c Wed Jul 5 14:34:29 2000 +++ AP615_source/op.c Thu Jun 29 08:38:03 2000 @@ -162,6 +162,7 @@ do { if ((sv = svp[off]) && sv != &PL_sv_undef + && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0) && ((SvFLAGS(sv) & SVpad_OUR) && GvSTASH(sv) == ourstash) && strEQ(name, SvPVX(sv))) { @@ -321,9 +322,12 @@ } } else if (!CvUNIQUE(PL_compcv)) { - if (ckWARN(WARN_CLOSURE) && !SvFAKE(sv) && !CvUNIQUE(cv)) + if (ckWARN(WARN_CLOSURE) && !SvFAKE(sv) && !CvUNIQUE(cv) + && !(SvFLAGS(sv) & SVpad_OUR)) + { Perl_warner(aTHX_ WARN_CLOSURE, "Variable \"%s\" will not stay shared", name); + } } } av_store(PL_comppad, newoff, SvREFCNT_inc(oldsv)); @@ -780,6 +784,7 @@ cSVOPo->op_sv = Nullsv; #endif break; + case OP_METHOD_NAMED: case OP_CONST: SvREFCNT_dec(cSVOPo->op_sv); cSVOPo->op_sv = Nullsv; @@ -839,8 +844,8 @@ { Safefree(cop->cop_label); #ifdef USE_ITHREADS - Safefree(CopFILE(cop)); /* XXXXX share in a pvtable? */ - Safefree(CopSTASHPV(cop)); /* XXXXX share in a pvtable? */ + Safefree(CopFILE(cop)); /* XXX share in a pvtable? */ + Safefree(CopSTASHPV(cop)); /* XXX share in a pvtable? */ #else /* NOTE: COP.cop_stash is not refcounted */ SvREFCNT_dec(CopFILEGV(cop)); @@ -3222,8 +3227,15 @@ sv = va_arg(*args, SV*); } } - utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), - veop, modname, imop); + { + line_t ocopline = PL_copline; + int oexpect = PL_expect; + + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), + veop, modname, imop); + PL_expect = oexpect; + PL_copline = ocopline; + } } OP * @@ -3486,9 +3498,9 @@ PL_copline = NOLINE; } #ifdef USE_ITHREADS - CopFILE_set(cop, CopFILE(PL_curcop)); /* XXXXX share in a pvtable? */ + CopFILE_set(cop, CopFILE(PL_curcop)); /* XXX share in a pvtable? */ #else - CopFILEGV_set(cop, (GV*)SvREFCNT_inc(CopFILEGV(PL_curcop))); + CopFILEGV_set(cop, CopFILEGV(PL_curcop)); #endif CopSTASH_set(cop, PL_curstash); @@ -3848,7 +3860,10 @@ loopflags |= OPpLOOP_CONTINUE; } if (expr) { - cont = append_elem(OP_LINESEQ, cont, newOP(OP_UNSTACK, 0)); + OP *unstack = newOP(OP_UNSTACK, 0); + if (!next) + next = unstack; + cont = append_elem(OP_LINESEQ, cont, unstack); if ((line_t)whileline != NOLINE) { PL_copline = whileline; cont = append_elem(OP_LINESEQ, cont, @@ -3871,8 +3886,6 @@ if (listop) ((LISTOP*)listop)->op_last->op_next = condop = (o == listop ? redo : LINKLIST(o)); - if (!next) - next = condop; } else o = listop; @@ -4636,8 +4649,8 @@ if (!PL_beginav) PL_beginav = newAV(); DEBUG_x( dump_sub(gv) ); - av_push(PL_beginav, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_push(PL_beginav, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ call_list(oldscope, PL_beginav); PL_curcop = &PL_compiling; @@ -4649,8 +4662,8 @@ PL_endav = newAV(); DEBUG_x( dump_sub(gv) ); av_unshift(PL_endav, 1); - av_store(PL_endav, 0, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_store(PL_endav, 0, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } else if (strEQ(s, "CHECK") && !PL_error_count) { if (!PL_checkav) @@ -4659,8 +4672,8 @@ if (PL_main_start && ckWARN(WARN_VOID)) Perl_warner(aTHX_ WARN_VOID, "Too late to run CHECK block"); av_unshift(PL_checkav, 1); - av_store(PL_checkav, 0, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_store(PL_checkav, 0, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } else if (strEQ(s, "INIT") && !PL_error_count) { if (!PL_initav) @@ -4668,8 +4681,8 @@ DEBUG_x( dump_sub(gv) ); if (PL_main_start && ckWARN(WARN_VOID)) Perl_warner(aTHX_ WARN_VOID, "Too late to run INIT block"); - av_push(PL_initav, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_push(PL_initav, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } } @@ -4695,10 +4708,11 @@ dTHR; ENTER; - SAVECOPLINE(PL_curcop); - SAVEHINTS(); + SAVECOPLINE(PL_curcop); CopLINE_set(PL_curcop, PL_copline); + + SAVEHINTS(); PL_hints &= ~HINT_BLOCK_SCOPE; if (stash) { @@ -4795,15 +4809,15 @@ if (strEQ(s, "BEGIN")) { if (!PL_beginav) PL_beginav = newAV(); - av_push(PL_beginav, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_push(PL_beginav, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } else if (strEQ(s, "END")) { if (!PL_endav) PL_endav = newAV(); av_unshift(PL_endav, 1); - av_store(PL_endav, 0, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_store(PL_endav, 0, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } else if (strEQ(s, "CHECK")) { if (!PL_checkav) @@ -4811,16 +4825,16 @@ if (PL_main_start && ckWARN(WARN_VOID)) Perl_warner(aTHX_ WARN_VOID, "Too late to run CHECK block"); av_unshift(PL_checkav, 1); - av_store(PL_checkav, 0, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_store(PL_checkav, 0, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } else if (strEQ(s, "INIT")) { if (!PL_initav) PL_initav = newAV(); if (PL_main_start && ckWARN(WARN_VOID)) Perl_warner(aTHX_ WARN_VOID, "Too late to run INIT block"); - av_push(PL_initav, SvREFCNT_inc(cv)); - GvCV(gv) = 0; + av_push(PL_initav, (SV*)cv); + GvCV(gv) = 0; /* cv has been hijacked */ } } else @@ -5324,6 +5338,7 @@ #ifdef USE_ITHREADS /* XXX hack: dependence on sizeof(PADOP) <= sizeof(SVOP) */ kPADOP->op_padix = pad_alloc(OP_GV, SVs_PADTMP); + SvREFCNT_dec(PL_curpad[kPADOP->op_padix]); GvIN_PAD_on(gv); PL_curpad[kPADOP->op_padix] = SvREFCNT_inc(gv); #else @@ -5994,6 +6009,7 @@ OP * Perl_ck_sort(pTHX_ OP *o) { + OP *firstkid; o->op_private = 0; #ifdef USE_LOCALE if (PL_hints & HINT_LOCALE) @@ -6002,10 +6018,10 @@ if (o->op_type == OP_SORT && o->op_flags & OPf_STACKED) simplify_sort(o); - if (o->op_flags & OPf_STACKED) { /* may have been cleared */ - OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */ + firstkid = cLISTOPo->op_first->op_sibling; /* get past pushmark */ + if (o->op_flags & OPf_STACKED) { /* may have been cleared */ OP *k; - kid = kUNOP->op_first; /* get past null */ + OP *kid = cUNOPx(firstkid)->op_first; /* get past null */ if (kid->op_type == OP_SCOPE || kid->op_type == OP_LEAVE) { linklist(kid); @@ -6035,17 +6051,26 @@ } peep(k); - kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */ - if (o->op_type == OP_SORT) + kid = firstkid; + if (o->op_type == OP_SORT) { + /* provide scalar context for comparison function/block */ + kid = scalar(kid); kid->op_next = kid; + } else kid->op_next = k; o->op_flags |= OPf_SPECIAL; } else if (kid->op_type == OP_RV2SV || kid->op_type == OP_PADSV) - null(cLISTOPo->op_first->op_sibling); + null(firstkid); + + firstkid = firstkid->op_sibling; } + /* provide list context for arguments */ + if (o->op_type == OP_SORT) + list(firstkid); + return o; } @@ -6251,7 +6276,9 @@ proto++; arg++; if (o2->op_type != OP_REFGEN && o2->op_type != OP_UNDEF) - bad_type(arg, "block", gv_ename(namegv), o2); + bad_type(arg, + arg == 1 ? "block or sub {}" : "sub {}", + gv_ename(namegv), o2); break; case '*': /* '*' allows any scalar type, including bareword */ @@ -6299,8 +6326,8 @@ bad_type(arg, "symbol", gv_ename(namegv), o2); goto wrapref; case '&': - if (o2->op_type != OP_RV2CV) - bad_type(arg, "sub", gv_ename(namegv), o2); + if (o2->op_type != OP_ENTERSUB) + bad_type(arg, "subroutine entry", gv_ename(namegv), o2); goto wrapref; case '$': if (o2->op_type != OP_RV2SV @@ -6417,9 +6444,18 @@ * for reference counts, sv_upgrade() etc. */ if (cSVOP->op_sv) { PADOFFSET ix = pad_alloc(OP_CONST, SVs_PADTMP); - SvREFCNT_dec(PL_curpad[ix]); - SvPADTMP_on(cSVOPo->op_sv); - PL_curpad[ix] = cSVOPo->op_sv; + if (SvPADTMP(cSVOPo->op_sv)) { + /* If op_sv is already a PADTMP then it is being used by + * another pad, so make a copy. */ + sv_setsv(PL_curpad[ix],cSVOPo->op_sv); + SvREADONLY_on(PL_curpad[ix]); + SvREFCNT_dec(cSVOPo->op_sv); + } + else { + SvREFCNT_dec(PL_curpad[ix]); + SvPADTMP_on(cSVOPo->op_sv); + PL_curpad[ix] = cSVOPo->op_sv; + } cSVOPo->op_sv = Nullsv; o->op_targ = ix; } diff -ruN perl-5.6.0/patchlevel.h AP615_source/patchlevel.h --- perl-5.6.0/patchlevel.h Wed Jul 5 14:34:30 2000 +++ AP615_source/patchlevel.h Thu May 25 01:14:39 2000 @@ -1,5 +1,7 @@ #ifndef __PATCHLEVEL_H_INCLUDED__ +#include "BuildInfo.h" + /* do not adjust the whitespace! Configure expects the numbers to be * exactly on the third column */ @@ -70,6 +72,7 @@ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) static char *local_patches[] = { NULL + ,ACTIVEPERL_LOCAL_PATCHES_ENTRY ,NULL }; diff -ruN perl-5.6.0/perl.c AP615_source/perl.c --- perl-5.6.0/perl.c Wed Jul 5 14:34:30 2000 +++ AP615_source/perl.c Thu Jun 29 08:38:11 2000 @@ -272,10 +272,15 @@ PL_localpatches = local_patches; /* For possible -v */ #endif +#ifdef HAVE_INTERP_INTERN + sys_intern_init(); +#endif + PerlIO_init(); /* Hook to IO system */ PL_fdpid = newAV(); /* for remembering popen pids by fd */ PL_modglobal = newHV(); /* pointers to per-interpreter module globals */ + PL_errors = newSVpvn("",0); ENTER; } @@ -595,9 +600,14 @@ if (!specialWARN(PL_compiling.cop_warnings)) SvREFCNT_dec(PL_compiling.cop_warnings); PL_compiling.cop_warnings = Nullsv; -#ifndef USE_ITHREADS +#ifdef USE_ITHREADS + Safefree(CopFILE(&PL_compiling)); + CopFILE(&PL_compiling) = Nullch; + Safefree(CopSTASHPV(&PL_compiling)); +#else SvREFCNT_dec(CopFILEGV(&PL_compiling)); - CopFILEGV_set(&PL_compiling, Nullgv); + CopFILEGV(&PL_compiling) = Nullgv; + /* cop_stash is not refcounted */ #endif /* Prepare to destruct main symbol table. */ @@ -1565,18 +1575,7 @@ /* name of the subroutine */ /* See G_* flags in cop.h */ { - dSP; - OP myop; - if (!PL_op) { - Zero(&myop, 1, OP); - PL_op = &myop; - } - XPUSHs(sv_2mortal(newSVpv(methname,0))); - PUTBACK; - pp_method(); - if (PL_op == &myop) - PL_op = Nullop; - return call_sv(*PL_stack_sp--, flags); + return call_sv(sv_2mortal(newSVpv(methname,0)), flags | G_METHOD); } /* May be called with any of a CV, a GV, or an SV containing the name. */ @@ -1591,11 +1590,11 @@ I32 Perl_call_sv(pTHX_ SV *sv, I32 flags) - /* See G_* flags in cop.h */ { dSP; LOGOP myop; /* fake syntax tree node */ + UNOP method_op; I32 oldmark; I32 retval; I32 oldscope; @@ -1633,6 +1632,14 @@ && !(flags & G_NODEBUG)) PL_op->op_private |= OPpENTERSUB_DB; + if (flags & G_METHOD) { + Zero(&method_op, 1, UNOP); + method_op.op_next = PL_op; + method_op.op_ppaddr = PL_ppaddr[OP_METHOD]; + myop.op_ppaddr = PL_ppaddr[OP_ENTERSUB]; + PL_op = (OP*)&method_op; + } + if (!(flags & G_EVAL)) { CATCH_SET(TRUE); call_body((OP*)&myop, FALSE); @@ -1640,7 +1647,7 @@ CATCH_SET(oldcatch); } else { - cLOGOP->op_other = PL_op; + myop.op_other = (OP*)&myop; PL_markstack_ptr--; /* we're trying to emulate pp_entertry() here */ { @@ -1650,7 +1657,7 @@ ENTER; SAVETMPS; - push_return(PL_op->op_next); + push_return(Nullop); PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), PL_stack_sp); PUSHEVAL(cx, 0, 0); PL_eval_root = PL_op; /* Only needed so that goto works right. */ @@ -1753,9 +1760,9 @@ if (PL_op == myop) { if (is_eval) - PL_op = Perl_pp_entereval(aTHX); + PL_op = Perl_pp_entereval(aTHX); /* this doesn't do a POPMARK */ else - PL_op = Perl_pp_entersub(aTHX); + PL_op = Perl_pp_entersub(aTHX); /* this does */ } if (PL_op) CALLRUNOPS(aTHX); @@ -1877,7 +1884,6 @@ dSP; SV* sv = newSVpv(p, 0); - PUSHMARK(SP); eval_sv(sv, G_SCALAR); SvREFCNT_dec(sv); @@ -1938,7 +1944,7 @@ "-0[octal] specify record separator (\\0, if no argument)", "-a autosplit mode with -n or -p (splits $_ into @F)", "-C enable native wide character system interfaces", -"-c check syntax only (runs BEGIN and END blocks)", +"-c check syntax only (runs BEGIN and CHECK blocks)", "-d[:debugger] run program under debugger", "-D[number/list] set debugging flags (argument is a bit mask or alphabets)", "-e 'command' one line of program (several -e's allowed, omit programfile)", @@ -1966,9 +1972,11 @@ }; char **p = usage_msg; - printf("\nUsage: %s [switches] [--] [programfile] [arguments]", name); + PerlIO_printf(PerlIO_stdout(), + "\nUsage: %s [switches] [--] [programfile] [arguments]", + name); while (*p) - printf("\n %s", *p++); + PerlIO_printf(PerlIO_stdout(), "\n %s", *p++); } /* This routine handles any switches that can be given during run */ @@ -1983,6 +1991,7 @@ case '0': { dTHR; + numlen = 0; /* disallow underscores */ rschar = (U32)scan_oct(s, 4, &numlen); SvREFCNT_dec(PL_nrs); if (rschar & ~((U8)~0)) @@ -2098,6 +2107,7 @@ if (isDIGIT(*s)) { PL_ors = savepv("\n"); PL_orslen = 1; + numlen = 0; /* disallow underscores */ *PL_ors = (char)scan_oct(s, 3 + (*s == '0'), &numlen); s += numlen; } @@ -2175,57 +2185,75 @@ s++; return s; case 'v': - printf(Perl_form(aTHX_ "\nThis is perl, v%vd built for %s", - PL_patchlevel, ARCHNAME)); + PerlIO_printf(PerlIO_stdout(), + Perl_form(aTHX_ "\nThis is perl, v%vd built for %s", + PL_patchlevel, ARCHNAME)); #if defined(LOCAL_PATCH_COUNT) if (LOCAL_PATCH_COUNT > 0) - printf("\n(with %d registered patch%s, see perl -V for more detail)", - (int)LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : ""); + PerlIO_printf(PerlIO_stdout(), + "\n(with %d registered patch%s, " + "see perl -V for more detail)", + (int)LOCAL_PATCH_COUNT, + (LOCAL_PATCH_COUNT!=1) ? "es" : ""); #endif - printf("\n\nCopyright 1987-2000, Larry Wall\n"); + PerlIO_printf(PerlIO_stdout(), + "\n\nCopyright 1987-2000, Larry Wall\n"); #ifdef MSDOS - printf("\nMS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n"); + PerlIO_printf(PerlIO_stdout(), + "\nMS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n"); #endif #ifdef DJGPP - printf("djgpp v2 port (jpl5003c) by Hirofumi Watanabe, 1996\n"); - printf("djgpp v2 port (perl5004+) by Laszlo Molnar, 1997-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "djgpp v2 port (jpl5003c) by Hirofumi Watanabe, 1996\n" + "djgpp v2 port (perl5004+) by Laszlo Molnar, 1997-1999\n"); #endif #ifdef OS2 - printf("\n\nOS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n" - "Version 5 port Copyright (c) 1994-1999, Andreas Kaiser, Ilya Zakharevich\n"); + PerlIO_printf(PerlIO_stdout(), + "\n\nOS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n" + "Version 5 port Copyright (c) 1994-1999, Andreas Kaiser, Ilya Zakharevich\n"); #endif #ifdef atarist - printf("atariST series port, ++jrb bammi@cadence.com\n"); + PerlIO_printf(PerlIO_stdout(), + "atariST series port, ++jrb bammi@cadence.com\n"); #endif #ifdef __BEOS__ - printf("BeOS port Copyright Tom Spindler, 1997-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "BeOS port Copyright Tom Spindler, 1997-1999\n"); #endif #ifdef MPE - printf("MPE/iX port Copyright by Mark Klein and Mark Bixby, 1996-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "MPE/iX port Copyright by Mark Klein and Mark Bixby, 1996-1999\n"); #endif #ifdef OEMVS - printf("MVS (OS390) port by Mortice Kern Systems, 1997-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "MVS (OS390) port by Mortice Kern Systems, 1997-1999\n"); #endif #ifdef __VOS__ - printf("Stratus VOS port by Paul_Green@stratus.com, 1997-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "Stratus VOS port by Paul_Green@stratus.com, 1997-1999\n"); #endif #ifdef __OPEN_VM - printf("VM/ESA port by Neale Ferguson, 1998-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "VM/ESA port by Neale Ferguson, 1998-1999\n"); #endif #ifdef POSIX_BC - printf("BS2000 (POSIX) port by Start Amadeus GmbH, 1998-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "BS2000 (POSIX) port by Start Amadeus GmbH, 1998-1999\n"); #endif #ifdef __MINT__ - printf("MiNT port by Guido Flohr, 1997-1999\n"); + PerlIO_printf(PerlIO_stdout(), + "MiNT port by Guido Flohr, 1997-1999\n"); #endif #ifdef EPOC - printf("EPOC port by Olaf Flebbe, 1999-2000\n"); + PerlIO_printf(PerlIO_stdout(), + "EPOC port by Olaf Flebbe, 1999-2000\n"); #endif #ifdef BINARY_BUILD_NOTICE BINARY_BUILD_NOTICE; #endif - printf("\n\ + PerlIO_printf(PerlIO_stdout(), + "\n\ Perl may be copied only under the terms of either the Artistic License or the\n\ GNU General Public License, which may be found in the Perl 5.0 source kit.\n\n\ Complete documentation for Perl, including FAQ lists, should be found on\n\ @@ -2425,6 +2453,7 @@ CopSTASH_set(&PL_compiling, PL_defstash); PL_debstash = GvHV(gv_fetchpv("DB::", GV_ADDMULTI, SVt_PVHV)); PL_globalstash = GvHV(gv_fetchpv("CORE::GLOBAL::", GV_ADDMULTI, SVt_PVHV)); + PL_nullstash = GvHV(gv_fetchpv("::", GV_ADDMULTI, SVt_PVHV)); /* We must init $/ before switches are processed. */ sv_setpvn(get_sv("/", TRUE), "\n", 1); } @@ -2456,6 +2485,11 @@ } } +#ifdef USE_ITHREADS + Safefree(CopFILE(PL_curcop)); +#else + SvREFCNT_dec(CopFILEGV(PL_curcop)); +#endif CopFILE_set(PL_curcop, PL_origfilename); if (strEQ(PL_origfilename,"-")) scriptname = ""; @@ -2478,7 +2512,7 @@ sv_catpvn(sv, "-I", 2); sv_catpv(sv,PRIVLIB_EXP); -#ifdef MSDOS +#if defined(MSDOS) || defined(WIN32) Perl_sv_setpvf(aTHX_ cmd, "\ sed %s -e \"/^[^#]/b\" \ -e \"/^#[ ]*include[ ]/b\" \ @@ -3180,7 +3214,7 @@ SV *sv = newSVpv(argv[0],0); av_push(GvAVn(PL_argvgv),sv); if (PL_widesyscalls) - sv_utf8_upgrade(sv); + (void)sv_utf8_decode(sv); } } if ((PL_envgv = gv_fetchpv("ENV",TRUE, SVt_PVHV))) { diff -ruN perl-5.6.0/perl.h AP615_source/perl.h --- perl-5.6.0/perl.h Wed Jul 5 14:34:30 2000 +++ AP615_source/perl.h Thu Jun 29 08:32:57 2000 @@ -242,6 +242,7 @@ # define aTHXo aTHX # define aTHXo_ aTHX_ # define dTHXo dTHX +# define dTHXoa(x) dTHXa(x) #endif #ifndef pTHXx diff -ruN perl-5.6.0/perlapi.c AP615_source/perlapi.c --- perl-5.6.0/perlapi.c Wed Jul 5 14:34:31 2000 +++ AP615_source/perlapi.c Thu Jun 29 08:37:05 2000 @@ -616,9 +616,9 @@ #undef Perl_do_binmode int -Perl_do_binmode(pTHXo_ PerlIO *fp, int iotype, int flag) +Perl_do_binmode(pTHXo_ PerlIO *fp, int iotype, int mode) { - return ((CPerlObj*)pPerl)->Perl_do_binmode(fp, iotype, flag); + return ((CPerlObj*)pPerl)->Perl_do_binmode(fp, iotype, mode); } #undef Perl_do_close @@ -632,6 +632,13 @@ #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #endif +#undef Perl_do_join +void +Perl_do_join(pTHXo_ SV* sv, SV* del, SV** mark, SV** sp) +{ + ((CPerlObj*)pPerl)->Perl_do_join(sv, del, mark, sp); +} + #undef Perl_do_open bool Perl_do_open(pTHXo_ GV* gv, char* name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO* supplied_fp) @@ -2343,6 +2350,13 @@ { return ((CPerlObj*)pPerl)->Perl_rninstr(big, bigend, little, lend); } + +#undef Perl_rsignal +Sighandler_t +Perl_rsignal(pTHXo_ int i, Sighandler_t t) +{ + return ((CPerlObj*)pPerl)->Perl_rsignal(i, t); +} #if !defined(HAS_RENAME) #endif @@ -2444,6 +2458,13 @@ ((CPerlObj*)pPerl)->Perl_save_generic_svref(sptr); } +#undef Perl_save_generic_pvref +void +Perl_save_generic_pvref(pTHXo_ char** str) +{ + ((CPerlObj*)pPerl)->Perl_save_generic_pvref(str); +} + #undef Perl_save_gp void Perl_save_gp(pTHXo_ GV* gv, I32 empty) @@ -3366,6 +3387,13 @@ { ((CPerlObj*)pPerl)->Perl_vwarner(err, pat, args); } + +#undef Perl_whichsig +I32 +Perl_whichsig(pTHXo_ char* sig) +{ + return ((CPerlObj*)pPerl)->Perl_whichsig(sig); +} #if defined(USE_PURE_BISON) #else #endif @@ -3920,6 +3948,15 @@ Perl_ptr_table_split(pTHXo_ PTR_TBL_t *tbl) { ((CPerlObj*)pPerl)->Perl_ptr_table_split(tbl); +} +#endif +#if defined(HAVE_INTERP_INTERN) + +#undef Perl_sys_intern_init +void +Perl_sys_intern_init(pTHXo) +{ + ((CPerlObj*)pPerl)->Perl_sys_intern_init(); } #endif #if defined(PERL_OBJECT) diff -ruN perl-5.6.0/perlapi.h AP615_source/perlapi.h --- perl-5.6.0/perlapi.h Wed Jul 5 14:34:31 2000 +++ AP615_source/perlapi.h Thu Jun 29 08:26:33 2000 @@ -382,6 +382,8 @@ #define PL_nthreads (*Perl_Inthreads_ptr(aTHXo)) #undef PL_nthreads_cond #define PL_nthreads_cond (*Perl_Inthreads_cond_ptr(aTHXo)) +#undef PL_nullstash +#define PL_nullstash (*Perl_Inullstash_ptr(aTHXo)) #undef PL_numeric_local #define PL_numeric_local (*Perl_Inumeric_local_ptr(aTHXo)) #undef PL_numeric_name diff -ruN perl-5.6.0/perly.c AP615_source/perly.c --- perl-5.6.0/perly.c Wed Jul 5 14:34:31 2000 +++ AP615_source/perly.c Thu Jun 29 08:37:05 2000 @@ -1386,6 +1386,9 @@ #endif struct ysv *ysave; +#ifdef USE_ITHREADS + ENTER; /* force yydestruct() before we return */ +#endif New(73, ysave, 1, struct ysv); SAVEDESTRUCTOR_X(yydestruct, ysave); ysave->oldyydebug = yydebug; @@ -2477,6 +2480,9 @@ yyabort: retval = 1; yyaccept: +#ifdef USE_ITHREADS + LEAVE; /* force yydestruct() before we return */ +#endif return retval; } diff -ruN perl-5.6.0/perly_c.diff AP615_source/perly_c.diff --- perl-5.6.0/perly_c.diff Wed Jul 5 14:34:31 2000 +++ AP615_source/perly_c.diff Thu Jun 29 08:37:05 2000 @@ -12,7 +12,7 @@ if (yys = getenv("YYDEBUG")) { yyn = *yys; ---- 1447,1473 ---- +--- 1447,1476 ---- yyparse() { register int yym, yyn, yystate; @@ -27,6 +27,9 @@ ! #endif + struct ysv *ysave; ++ #ifdef USE_ITHREADS ++ ENTER; /* force yydestruct() before we return */ ++ #endif + New(73, ysave, 1, struct ysv); + SAVEDESTRUCTOR_X(yydestruct, ysave); + ysave->oldyydebug = yydebug; @@ -42,7 +45,7 @@ yyn = *yys; *************** *** 1463,1468 **** ---- 1480,1495 ---- +--- 1483,1498 ---- yyerrflag = 0; yychar = (-1); @@ -68,7 +71,7 @@ } *++yyssp = yystate = yytable[yyn]; *++yyvsp = yylval; ---- 1520,1538 ---- +--- 1523,1541 ---- #endif if (yyssp >= yyss + yystacksize - 1) { @@ -97,7 +100,7 @@ } *++yyssp = yystate = yytable[yyn]; *++yyvsp = yylval; ---- 1573,1591 ---- +--- 1576,1594 ---- #endif if (yyssp >= yyss + yystacksize - 1) { @@ -134,7 +137,7 @@ yyaccept: ! return (0); } ---- 2524,2569 ---- +--- 2527,2575 ---- #endif if (yyssp >= yyss + yystacksize - 1) { @@ -160,6 +163,9 @@ yyabort: ! retval = 1; yyaccept: +! #ifdef USE_ITHREADS +! LEAVE; /* force yydestruct() before we return */ +! #endif ! return retval; ! } ! diff -ruN perl-5.6.0/pod/perlapi.pod AP615_source/pod/perlapi.pod --- perl-5.6.0/pod/perlapi.pod Wed Jul 5 14:34:32 2000 +++ AP615_source/pod/perlapi.pod Thu Jun 29 08:33:12 2000 @@ -165,9 +165,16 @@ =item croak -This is the XSUB-writer's interface to Perl's C function. Use this -function the same way you use the C C function. See -C. +This is the XSUB-writer's interface to Perl's C function. +Normally use this function the same way you use the C C +function. See C. + +If you want to throw an exception object, assign the object to +C<$@> and then pass C to croak(): + + errsv = get_sv("@", TRUE); + sv_setsv(errsv, exception_object); + croak(Nullch); void croak(const char* pat, ...) diff -ruN perl-5.6.0/pod/perldelta.pod AP615_source/pod/perldelta.pod --- perl-5.6.0/pod/perldelta.pod Wed Jul 5 14:34:32 2000 +++ AP615_source/pod/perldelta.pod Thu Jun 29 08:31:12 2000 @@ -2847,11 +2847,6 @@ These expressions will get run-time errors in some future release of Perl. -=head2 Windows 2000 - -Windows 2000 is known to fail test 22 in lib/open3.t (cause unknown at -this time). That test passes under Windows NT. - =head2 Experimental features As discussed above, many features are still experimental. Interfaces and diff -ruN perl-5.6.0/pod/perlfunc.pod AP615_source/pod/perlfunc.pod --- perl-5.6.0/pod/perlfunc.pod Wed Jul 5 14:34:34 2000 +++ AP615_source/pod/perlfunc.pod Thu Jun 29 08:26:51 2000 @@ -1983,7 +1983,7 @@ indicating December. $year is the number of years since 1900. That is, $year is C<123> in year 2023. $wday is the day of the week, with 0 indicating Sunday and 3 indicating Wednesday. $yday is the day of -the year, in the range C<1..365> (or C<1..366> in leap years.) +the year, in the range C<0..364> (or C<0..365> in leap years.) Note that the $year element is I simply the last two digits of the year. If you assume it is, then you create non-Y2K-compliant @@ -2351,7 +2351,7 @@ indicating December. $year is the number of years since 1900. That is, $year is C<123> in year 2023. $wday is the day of the week, with 0 indicating Sunday and 3 indicating Wednesday. $yday is the day of -the year, in the range C<1..365> (or C<1..366> in leap years.) $isdst +the year, in the range C<0..364> (or C<0..365> in leap years.) $isdst is true if the specified time occurs during daylight savings time, false otherwise. diff -ruN perl-5.6.0/pod/perlintern.pod AP615_source/pod/perlintern.pod --- perl-5.6.0/pod/perlintern.pod Wed Jul 5 14:34:34 2000 +++ AP615_source/pod/perlintern.pod Thu Jun 29 08:33:12 2000 @@ -12,6 +12,18 @@ =over 8 +=item is_gv_magical + +Returns C if given the name of a magical GV. + +Currently only useful internally when determining if a GV should be +created even in rvalue contexts. + +C is not used at present but available for future extension to +allow selecting particular classes of magical variable. + + bool is_gv_magical(char *name, STRLEN len, U32 flags) + =back =head1 AUTHORS diff -ruN perl-5.6.0/pod/perlvar.pod AP615_source/pod/perlvar.pod --- perl-5.6.0/pod/perlvar.pod Wed Jul 5 14:34:37 2000 +++ AP615_source/pod/perlvar.pod Thu Jun 29 08:31:31 2000 @@ -174,6 +174,8 @@ (Mnemonic: be positive and forward looking.) This variable is read-only and dynamically scoped to the current BLOCK. +=item @LAST_MATCH_END + =item @+ This array holds the offsets of the ends of the last successful @@ -411,6 +413,8 @@ channel. Used with formats. (Mnemonic: lines_on_page - lines_printed.) + +=item @LAST_MATCH_START =item @- diff -ruN perl-5.6.0/pp.c AP615_source/pp.c --- perl-5.6.0/pp.c Wed Jul 5 14:34:38 2000 +++ AP615_source/pp.c Thu Jun 29 08:36:49 2000 @@ -198,7 +198,7 @@ else { if (SvTYPE(sv) != SVt_PVGV) { char *sym; - STRLEN n_a; + STRLEN len; if (SvGMAGICAL(sv)) { mg_get(sv); @@ -236,13 +236,17 @@ report_uninit(); RETSETUNDEF; } - sym = SvPV(sv, n_a); + sym = SvPV(sv,len); if ((PL_op->op_flags & OPf_SPECIAL) && !(PL_op->op_flags & OPf_MOD)) { sv = (SV*)gv_fetchpv(sym, FALSE, SVt_PVGV); - if (!sv) + if (!sv + && (!is_gv_magical(sym,len,0) + || !(sv = (SV*)gv_fetchpv(sym, TRUE, SVt_PVGV)))) + { RETSETUNDEF; + } } else { if (PL_op->op_private & HINT_STRICT_REFS) @@ -276,7 +280,7 @@ else { GV *gv = (GV*)sv; char *sym; - STRLEN n_a; + STRLEN len; if (SvTYPE(gv) != SVt_PVGV) { if (SvGMAGICAL(sv)) { @@ -292,13 +296,17 @@ report_uninit(); RETSETUNDEF; } - sym = SvPV(sv, n_a); + sym = SvPV(sv, len); if ((PL_op->op_flags & OPf_SPECIAL) && !(PL_op->op_flags & OPf_MOD)) { gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PV); - if (!gv) + if (!gv + && (!is_gv_magical(sym,len,0) + || !(gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PV)))) + { RETSETUNDEF; + } } else { if (PL_op->op_private & HINT_STRICT_REFS) @@ -961,7 +969,7 @@ NV dright; NV dleft; - if (SvIOK(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)) { + if (SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)) { IV i = SvIVX(POPs); right = (right_neg = (i < 0)) ? -i : i; } @@ -973,7 +981,7 @@ dright = -dright; } - if (!use_double && SvIOK(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)) { + if (!use_double && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)) { IV i = SvIVX(POPs); left = (left_neg = (i < 0)) ? -i : i; } @@ -1076,10 +1084,10 @@ SP -= items; } else { /* Note: mark already snarfed by pp_list */ - SV *tmpstr; + SV *tmpstr = POPs; STRLEN len; + bool isutf = DO_UTF8(tmpstr); - tmpstr = POPs; SvSetSV(TARG, tmpstr); SvPV_force(TARG, len); if (count != 1) { @@ -1092,7 +1100,10 @@ } *SvEND(TARG) = '\0'; } - (void)SvPOK_only(TARG); + if (isutf) + (void)SvPOK_only_UTF8(TARG); + else + (void)SvPOK_only(TARG); PUSHTARG; } RETURN; @@ -1892,6 +1903,7 @@ STRLEN n_a; tmps = POPpx; + argtype = 1; /* allow underscores */ XPUSHn(scan_hex(tmps, 99, &argtype)); RETURN; } @@ -1909,6 +1921,7 @@ tmps++; if (*tmps == '0') tmps++; + argtype = 1; /* allow underscores */ if (*tmps == 'x') value = scan_hex(++tmps, 99, &argtype); else if (*tmps == 'b') @@ -2013,12 +2026,12 @@ RETPUSHUNDEF; } else { - if (utfcurlen) { + if (utfcurlen) sv_pos_u2b(sv, &pos, &rem); - SvUTF8_on(TARG); - } tmps += pos; sv_setpvn(TARG, tmps, rem); + if (utfcurlen) + SvUTF8_on(TARG); if (repl) sv_insert(sv, pos, rem, repl, repl_len); else if (lvalue) { /* it's an lvalue! */ @@ -2031,7 +2044,7 @@ "Attempt to use reference as lvalue in substr"); } if (SvOK(sv)) /* is it defined ? */ - (void)SvPOK_only(sv); + (void)SvPOK_only_UTF8(sv); else sv_setpvn(sv,"",0); /* avoid lexical reincarnation */ } @@ -2214,7 +2227,6 @@ tmps = SvPVX(TARG); *tmps++ = value; *tmps = '\0'; - SvUTF8_off(TARG); /* decontaminate */ (void)SvPOK_only(TARG); XPUSHs(TARG); RETURN; @@ -2547,7 +2559,7 @@ } *d = '\0'; SvCUR_set(TARG, d - SvPVX(TARG)); - (void)SvPOK_only(TARG); + (void)SvPOK_only_UTF8(TARG); } else sv_setpvn(TARG, s, len); @@ -3236,7 +3248,7 @@ *up++ = *down; *down-- = tmp; } - (void)SvPOK_only(TARG); + (void)SvPOK_only_UTF8(TARG); } SP = MARK + 1; SETTARG; diff -ruN perl-5.6.0/pp_ctl.c AP615_source/pp_ctl.c --- perl-5.6.0/pp_ctl.c Wed Jul 5 14:34:38 2000 +++ AP615_source/pp_ctl.c Thu Jun 29 08:38:17 2000 @@ -883,15 +883,18 @@ CATCH_SET(TRUE); PUSHSTACKi(PERLSI_SORT); - if (PL_sortstash != stash) { - PL_firstgv = gv_fetchpv("a", TRUE, SVt_PV); - PL_secondgv = gv_fetchpv("b", TRUE, SVt_PV); - PL_sortstash = stash; + if (!hasargs && !is_xsub) { + if (PL_sortstash != stash || !PL_firstgv || !PL_secondgv) { + SAVESPTR(PL_firstgv); + SAVESPTR(PL_secondgv); + PL_firstgv = gv_fetchpv("a", TRUE, SVt_PV); + PL_secondgv = gv_fetchpv("b", TRUE, SVt_PV); + PL_sortstash = stash; + } + SAVESPTR(GvSV(PL_firstgv)); + SAVESPTR(GvSV(PL_secondgv)); } - SAVESPTR(GvSV(PL_firstgv)); - SAVESPTR(GvSV(PL_secondgv)); - PUSHBLOCK(cx, CXt_NULL, PL_stack_base); if (!(PL_op->op_flags & OPf_SPECIAL)) { cx->cx_type = CXt_SUB; @@ -1521,15 +1524,21 @@ else PUSHs(sv_2mortal(newSViv(gimme & G_ARRAY))); if (CxTYPE(cx) == CXt_EVAL) { + /* eval STRING */ if (cx->blk_eval.old_op_type == OP_ENTEREVAL) { PUSHs(cx->blk_eval.cur_text); PUSHs(&PL_sv_no); } - /* try blocks have old_namesv == 0 */ + /* require */ else if (cx->blk_eval.old_namesv) { PUSHs(sv_2mortal(newSVsv(cx->blk_eval.old_namesv))); PUSHs(&PL_sv_yes); } + /* eval BLOCK (try blocks have old_namesv == 0) */ + else { + PUSHs(&PL_sv_undef); + PUSHs(&PL_sv_undef); + } } else { PUSHs(&PL_sv_undef); @@ -1546,7 +1555,7 @@ PL_dbargs = GvAV(gv_AVadd(tmpgv = gv_fetchpv("DB::args", TRUE, SVt_PVAV))); GvMULTI_on(tmpgv); - AvREAL_off(PL_dbargs); /* XXX Should be REIFY */ + AvREAL_off(PL_dbargs); /* XXX should be REIFY (see av.h) */ } if (AvMAX(PL_dbargs) < AvFILLp(ary) + off) @@ -1562,9 +1571,12 @@ { SV * mask ; SV * old_warnings = cx->blk_oldcop->cop_warnings ; - if (old_warnings == pWARN_NONE || old_warnings == pWARN_STD) + + if (old_warnings == pWARN_NONE || + (old_warnings == pWARN_STD && (PL_dowarn & G_WARN_ON) == 0)) mask = newSVpvn(WARN_NONEstring, WARNsize) ; - else if (old_warnings == pWARN_ALL) + else if (old_warnings == pWARN_ALL || + (old_warnings == pWARN_STD && PL_dowarn & G_WARN_ON)) mask = newSVpvn(WARN_ALLstring, WARNsize) ; else mask = newSVsv(old_warnings); @@ -1979,7 +1991,7 @@ { I32 cxix; register PERL_CONTEXT *cx; - I32 oldsave; + I32 inner; if (PL_op->op_flags & OPf_SPECIAL) { cxix = dopoptoloop(cxstack_ix); @@ -1994,13 +2006,12 @@ if (cxix < cxstack_ix) dounwind(cxix); + /* clear off anything above the scope we're re-entering, but + * save the rest until after a possible continue block */ + inner = PL_scopestack_ix; TOPBLOCK(cx); - - /* clean scope, but only if there's no continue block */ - if (!(cx->blk_loop.last_op->op_private & OPpLOOP_CONTINUE)) { - oldsave = PL_scopestack[PL_scopestack_ix - 1]; - LEAVE_SCOPE(oldsave); - } + if (PL_scopestack_ix < inner) + leave_scope(PL_scopestack[PL_scopestack_ix]); return cx->blk_loop.next_op; } @@ -2623,11 +2634,9 @@ /* switch to eval mode */ if (PL_curcop == &PL_compiling) { - SAVECOPSTASH(&PL_compiling); + SAVECOPSTASH_FREE(&PL_compiling); CopSTASH_set(&PL_compiling, PL_curstash); } - SAVECOPFILE(&PL_compiling); - SAVECOPLINE(&PL_compiling); if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) { SV *sv = sv_newmortal(); Perl_sv_setpvf(aTHX_ sv, "_<(%.10seval %lu)[%s:%"IVdf"]", @@ -2637,7 +2646,9 @@ } else sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq); + SAVECOPFILE_FREE(&PL_compiling); CopFILE_set(&PL_compiling, tmpbuf+2); + SAVECOPLINE(&PL_compiling); CopLINE_set(&PL_compiling, 1); /* XXX For Cs within BEGIN {} blocks, this ends up deleting the eval's FILEGV from the stash before gv_check() runs @@ -2757,6 +2768,7 @@ SAVESPTR(PL_beginav); PL_beginav = newAV(); SAVEFREESV(PL_beginav); + SAVEI32(PL_error_count); /* try to compile it */ @@ -2910,8 +2922,8 @@ sv = POPs; if (SvNIOKp(sv)) { - UV rev, ver, sver; - if (SvPOKp(sv)) { /* require v5.6.1 */ + if (SvPOK(sv) && SvNOK(sv)) { /* require v5.6.1 */ + UV rev = 0, ver = 0, sver = 0; I32 len; U8 *s = (U8*)SvPVX(sv); U8 *end = (U8*)SvPVX(sv) + SvCUR(sv); @@ -2923,14 +2935,8 @@ s += len; if (s < end) sver = utf8_to_uv(s, &len); - else - sver = 0; } - else - ver = 0; } - else - rev = 0; if (PERL_REVISION < rev || (PERL_REVISION == rev && (PERL_VERSION < ver @@ -2941,6 +2947,7 @@ "v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION, PERL_VERSION, PERL_SUBVERSION); } + RETPUSHYES; } else if (!SvPOKp(sv)) { /* require 5.005_03 */ if ((NV)PERL_REVISION + ((NV)PERL_VERSION/(NV)1000) @@ -2969,8 +2976,8 @@ PERL_SUBVERSION); } } + RETPUSHYES; } - RETPUSHYES; } name = SvPV(sv, len); if (!(name && len > 0 && *name)) @@ -3129,7 +3136,7 @@ } } } - SAVECOPFILE(&PL_compiling); + SAVECOPFILE_FREE(&PL_compiling); CopFILE_set(&PL_compiling, tryrsfp ? tryname : name); SvREFCNT_dec(namesv); if (!tryrsfp) { @@ -3239,7 +3246,6 @@ /* switch to eval mode */ - SAVECOPFILE(&PL_compiling); if (PERLDB_NAMEEVAL && CopLINE(PL_curcop)) { SV *sv = sv_newmortal(); Perl_sv_setpvf(aTHX_ sv, "_<(eval %lu)[%s:%"IVdf"]", @@ -3249,7 +3255,9 @@ } else sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq); + SAVECOPFILE_FREE(&PL_compiling); CopFILE_set(&PL_compiling, tmpbuf+2); + SAVECOPLINE(&PL_compiling); CopLINE_set(&PL_compiling, 1); /* XXX For Cs within BEGIN {} blocks, this ends up deleting the eval's FILEGV from the stash before gv_check() runs @@ -3261,9 +3269,11 @@ SAVEHINTS(); PL_hints = PL_op->op_targ; SAVESPTR(PL_compiling.cop_warnings); - if (!specialWARN(PL_compiling.cop_warnings)) { - PL_compiling.cop_warnings = newSVsv(PL_compiling.cop_warnings) ; - SAVEFREESV(PL_compiling.cop_warnings) ; + if (specialWARN(PL_curcop->cop_warnings)) + PL_compiling.cop_warnings = PL_curcop->cop_warnings; + else { + PL_compiling.cop_warnings = newSVsv(PL_curcop->cop_warnings); + SAVEFREESV(PL_compiling.cop_warnings); } push_return(PL_op->op_next); diff -ruN perl-5.6.0/pp_hot.c AP615_source/pp_hot.c --- perl-5.6.0/pp_hot.c Wed Jul 5 14:34:38 2000 +++ AP615_source/pp_hot.c Thu Jun 29 08:33:12 2000 @@ -146,22 +146,36 @@ dPOPTOPssrl; STRLEN len; char *s; + bool left_utf = DO_UTF8(left); + bool right_utf = DO_UTF8(right); if (TARG != left) { + if (right_utf && !left_utf) + sv_utf8_upgrade(left); s = SvPV(left,len); + SvUTF8_off(TARG); if (TARG == right) { + if (left_utf && !right_utf) + sv_utf8_upgrade(right); sv_insert(TARG, 0, 0, s, len); + if (left_utf || right_utf) + SvUTF8_on(TARG); SETs(TARG); RETURN; } sv_setpvn(TARG,s,len); } - else if (SvGMAGICAL(TARG)) + else if (SvGMAGICAL(TARG)) { mg_get(TARG); + if (right_utf && !left_utf) + sv_utf8_upgrade(left); + } else if (!SvOK(TARG) && SvTYPE(TARG) <= SVt_PVMG) { sv_setpv(TARG, ""); /* Suppress warning. */ s = SvPV_force(TARG, len); } + if (left_utf && !right_utf) + sv_utf8_upgrade(right); s = SvPV(right,len); if (SvOK(TARG)) { #if defined(PERL_Y2KWARN) @@ -176,19 +190,12 @@ } } #endif - if (DO_UTF8(right)) - sv_utf8_upgrade(TARG); sv_catpvn(TARG,s,len); - if (!IN_BYTE) { - if (SvUTF8(right)) - SvUTF8_on(TARG); - } - else if (!SvUTF8(right)) { - SvUTF8_off(TARG); - } } else sv_setpvn(TARG,s,len); /* suppress warning */ + if (left_utf || right_utf) + SvUTF8_on(TARG); SETTARG; RETURN; } @@ -455,7 +462,7 @@ if (SvTYPE(sv) != SVt_PVGV) { char *sym; - STRLEN n_a; + STRLEN len; if (SvGMAGICAL(sv)) { mg_get(sv); @@ -474,13 +481,17 @@ } RETSETUNDEF; } - sym = SvPV(sv,n_a); + sym = SvPV(sv,len); if ((PL_op->op_flags & OPf_SPECIAL) && !(PL_op->op_flags & OPf_MOD)) { gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVAV); - if (!gv) + if (!gv + && (!is_gv_magical(sym,len,0) + || !(gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVAV)))) + { RETSETUNDEF; + } } else { if (PL_op->op_private & HINT_STRICT_REFS) @@ -555,7 +566,7 @@ if (SvTYPE(sv) != SVt_PVGV) { char *sym; - STRLEN n_a; + STRLEN len; if (SvGMAGICAL(sv)) { mg_get(sv); @@ -574,13 +585,17 @@ } RETSETUNDEF; } - sym = SvPV(sv,n_a); + sym = SvPV(sv,len); if ((PL_op->op_flags & OPf_SPECIAL) && !(PL_op->op_flags & OPf_MOD)) { gv = (GV*)gv_fetchpv(sym, FALSE, SVt_PVHV); - if (!gv) + if (!gv + && (!is_gv_magical(sym,len,0) + || !(gv = (GV*)gv_fetchpv(sym, TRUE, SVt_PVHV)))) + { RETSETUNDEF; + } } else { if (PL_op->op_private & HINT_STRICT_REFS) @@ -1021,7 +1036,8 @@ && !PL_sawampersand && ((rx->reganch & ROPT_NOSCAN) || !((rx->reganch & RE_INTUIT_TAIL) - && (r_flags & REXEC_SCREAM)))) + && (r_flags & REXEC_SCREAM))) + && !SvROK(TARG)) /* Cannot trust since INTUIT cannot guess ^ */ goto yup; } if (CALLREGEXEC(aTHX_ rx, s, strend, truebase, minmatch, TARG, NULL, r_flags)) diff -ruN perl-5.6.0/pp_sys.c AP615_source/pp_sys.c --- perl-5.6.0/pp_sys.c Wed Jul 5 14:34:39 2000 +++ AP615_source/pp_sys.c Thu Jun 29 08:32:40 2000 @@ -3078,7 +3078,7 @@ (void)PerlIO_close(fp); RETPUSHUNDEF; } - do_binmode(fp, '<', TRUE); + do_binmode(fp, '<', O_BINARY); len = PerlIO_read(fp, tbuf, sizeof(tbuf)); (void)PerlIO_close(fp); if (len <= 0) { @@ -3680,6 +3680,8 @@ EXTEND(SP, 1); PERL_FLUSHALL_FOR_CHILD; childpid = PerlProc_fork(); + if (childpid == -1) + RETSETUNDEF; PUSHi(childpid); RETURN; # else diff -ruN perl-5.6.0/proto.h AP615_source/proto.h --- perl-5.6.0/proto.h Wed Jul 5 14:34:39 2000 +++ AP615_source/proto.h Thu Jun 29 08:37:05 2000 @@ -217,7 +217,7 @@ PERL_CALLCONV void Perl_dounwind(pTHX_ I32 cxix); PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp); PERL_CALLCONV bool Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int flag); -PERL_CALLCONV int Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int flag); +PERL_CALLCONV int Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode); PERL_CALLCONV void Perl_do_chop(pTHX_ SV* asv, SV* sv); PERL_CALLCONV bool Perl_do_close(pTHX_ GV* gv, bool not_implicit); PERL_CALLCONV bool Perl_do_eof(pTHX_ GV* gv); @@ -331,6 +331,7 @@ PERL_CALLCONV char* Perl_instr(pTHX_ const char* big, const char* little); PERL_CALLCONV bool Perl_io_close(pTHX_ IO* io, bool not_implicit); PERL_CALLCONV OP* Perl_invert(pTHX_ OP* cmd); +PERL_CALLCONV bool Perl_is_gv_magical(pTHX_ char *name, STRLEN len, U32 flags); PERL_CALLCONV bool Perl_is_uni_alnum(pTHX_ U32 c); PERL_CALLCONV bool Perl_is_uni_alnumc(pTHX_ U32 c); PERL_CALLCONV bool Perl_is_uni_idfirst(pTHX_ U32 c); @@ -650,6 +651,7 @@ PERL_CALLCONV void Perl_save_freeop(pTHX_ OP* o); PERL_CALLCONV void Perl_save_freepv(pTHX_ char* pv); PERL_CALLCONV void Perl_save_generic_svref(pTHX_ SV** sptr); +PERL_CALLCONV void Perl_save_generic_pvref(pTHX_ char** str); PERL_CALLCONV void Perl_save_gp(pTHX_ GV* gv, I32 empty); PERL_CALLCONV HV* Perl_save_hash(pTHX_ GV* gv); PERL_CALLCONV void Perl_save_helem(pTHX_ HV* hv, SV *key, SV **sptr); @@ -937,6 +939,9 @@ PERL_CALLCONV void* Perl_ptr_table_fetch(pTHX_ PTR_TBL_t *tbl, void *sv); PERL_CALLCONV void Perl_ptr_table_store(pTHX_ PTR_TBL_t *tbl, void *oldsv, void *newsv); PERL_CALLCONV void Perl_ptr_table_split(pTHX_ PTR_TBL_t *tbl); +#endif +#if defined(HAVE_INTERP_INTERN) +PERL_CALLCONV void Perl_sys_intern_init(pTHX); #endif #if defined(PERL_OBJECT) diff -ruN perl-5.6.0/regcomp.c AP615_source/regcomp.c --- perl-5.6.0/regcomp.c Wed Jul 5 14:34:39 2000 +++ AP615_source/regcomp.c Thu Jun 29 08:31:41 2000 @@ -2296,8 +2296,14 @@ nextchar(); ret = reg(1, &flags); if (ret == NULL) { - if (flags & TRYAGAIN) + if (flags & TRYAGAIN) { + if (PL_regcomp_parse == PL_regxend) { + /* Make parent create an empty node if needed. */ + *flagp |= TRYAGAIN; + return(NULL); + } goto tryagain; + } return(NULL); } *flagp |= flags&(HASWIDTH|SPSTART|SIMPLE); @@ -2599,8 +2605,10 @@ if (!e) FAIL("Missing right brace on \\x{}"); else if (UTF) { - ender = (UV)scan_hex(p + 1, e - p, &numlen); - if (numlen + len >= 127) { /* numlen is generous */ + numlen = 1; /* allow underscores */ + ender = (UV)scan_hex(p + 1, e - p - 1, &numlen); + /* numlen is generous */ + if (numlen + len >= 127) { p--; goto loopdone; } @@ -2610,6 +2618,7 @@ FAIL("Can't use \\x{} without 'use utf8' declaration"); } else { + numlen = 0; /* disallow underscores */ ender = (UV)scan_hex(p, 2, &numlen); p += numlen; } @@ -2623,6 +2632,7 @@ case '5': case '6': case '7': case '8':case '9': if (*p == '0' || (isDIGIT(p[1]) && atoi(p) >= PL_regnpar) ) { + numlen = 0; /* disallow underscores */ ender = (UV)scan_oct(p, 3, &numlen); p += numlen; } @@ -2934,6 +2944,7 @@ case 'a': value = '\057'; break; #endif case 'x': + numlen = 0; /* disallow underscores */ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen); PL_regcomp_parse += numlen; break; @@ -2943,6 +2954,7 @@ break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + numlen = 0; /* disallow underscores */ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen); PL_regcomp_parse += numlen; break; @@ -3408,12 +3420,14 @@ e = strchr(PL_regcomp_parse++, '}'); if (!e) FAIL("Missing right brace on \\x{}"); + numlen = 1; /* allow underscores */ value = (UV)scan_hex(PL_regcomp_parse, e - PL_regcomp_parse, &numlen); PL_regcomp_parse = e + 1; } else { + numlen = 0; /* disallow underscores */ value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen); PL_regcomp_parse += numlen; } @@ -3424,6 +3438,7 @@ break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': + numlen = 0; /* disallow underscores */ value = (UV)scan_oct(--PL_regcomp_parse, 3, &numlen); PL_regcomp_parse += numlen; break; diff -ruN perl-5.6.0/regexec.c AP615_source/regexec.c --- perl-5.6.0/regexec.c Wed Jul 5 14:34:39 2000 +++ AP615_source/regexec.c Thu Jun 29 08:36:45 2000 @@ -346,7 +346,9 @@ I32 slen; if ( !(prog->reganch & ROPT_ANCH_GPOS) /* Checked by the caller */ - && (sv && (strpos + SvCUR(sv) != strend)) ) { + /* SvCUR is not set on references: SvRV and SvPVX overlap */ + && sv && !SvROK(sv) + && (strpos + SvCUR(sv) != strend)) { DEBUG_r(PerlIO_printf(Perl_debug_log, "Not at start...\n")); goto fail; } @@ -597,9 +599,10 @@ find_anchor: while (t < strend - prog->minlen) { if (*t == '\n') { - if (t < s - prog->check_offset_min) { + if (t < check_at - prog->check_offset_min) { if (prog->anchored_substr) { - /* We definitely contradict the found anchored + /* Since we moved from the found position, + we definitely contradict the found anchored substr. Due to the above check we do not contradict "check" substr. Thus we can arrive here only if check substr @@ -610,12 +613,17 @@ PL_colors[0],PL_colors[1], (long)(strpos - i_strpos), (long)(strpos - i_strpos + prog->anchored_offset))); goto do_other_anchored; } + /* We don't contradict the found floating substring. */ + /* XXXX Why not check for STCLASS? */ s = t + 1; DEBUG_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m at offset %ld...\n", PL_colors[0],PL_colors[1], (long)(s - i_strpos))); goto set_useful; } - DEBUG_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m, restarting at offset %ld...\n", + /* Position contradicts check-string */ + /* XXXX probably better to look for check-string + than for "\n", so one should lower the limit for t? */ + DEBUG_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m, restarting lookup for check-string at offset %ld...\n", PL_colors[0],PL_colors[1], (long)(t + 1 - i_strpos))); strpos = s = t + 1; goto restart; @@ -626,19 +634,24 @@ PL_colors[0],PL_colors[1])); goto fail_finish; } + else { + DEBUG_r(PerlIO_printf(Perl_debug_log, "Starting position does not contradict /%s^%s/m...\n", + PL_colors[0],PL_colors[1])); + } s = t; set_useful: ++BmUSEFUL(prog->check_substr); /* hooray/5 */ } else { PL_bostr = tmp; - /* The found string does not prohibit matching at beg-of-str + /* The found string does not prohibit matching at strpos, - no optimization of calling REx engine can be performed, - unless it was an MBOL and we are not after MBOL. */ + unless it was an MBOL and we are not after MBOL, + or a future STCLASS check will fail this. */ try_at_start: /* Even in this situation we may use MBOL flag if strpos is offset wrt the start of the string. */ - if (ml_anch && sv + if (ml_anch && sv && !SvROK(sv) /* See prev comment on SvROK */ && (strpos + SvCUR(sv) != strend) && strpos[-1] != '\n' /* May be due to an implicit anchor of m{.*foo} */ && !(prog->reganch & ROPT_IMPLICIT)) @@ -647,8 +660,8 @@ goto find_anchor; } DEBUG_r( if (ml_anch) - PerlIO_printf(Perl_debug_log, "Does not contradict /%s^%s/m...\n", - PL_colors[0],PL_colors[1]); + PerlIO_printf(Perl_debug_log, "Position at offset %ld does not contradict /%s^%s/m...\n", + (long)(strpos - i_strpos), PL_colors[0],PL_colors[1]); ); success_at_start: if (!(prog->reganch & ROPT_NAUGHTY) /* XXXX If strpos moved? */ @@ -657,6 +670,7 @@ && prog->check_substr == prog->float_substr) { /* If flags & SOMETHING - do not do it many times on the same match */ + DEBUG_r(PerlIO_printf(Perl_debug_log, "... Disabling check substring...\n")); SvREFCNT_dec(prog->check_substr); prog->check_substr = Nullsv; /* disable */ prog->float_substr = Nullsv; /* clear */ @@ -723,7 +737,7 @@ goto fail; } DEBUG_r( PerlIO_printf(Perl_debug_log, - "Trying %s substr starting at offset %ld...\n", + "Looking for %s substr starting at offset %ld...\n", what, (long)(s + start_shift - i_strpos)) ); goto restart; } @@ -733,7 +747,7 @@ /* Recheck anchored substring, but not floating... */ s = check_at; DEBUG_r( PerlIO_printf(Perl_debug_log, - "Trying anchored substr starting at offset %ld...\n", + "Looking for anchored substr starting at offset %ld...\n", (long)(other_last - i_strpos)) ); goto do_other_anchored; } @@ -742,8 +756,8 @@ if (ml_anch) { s = t = t + 1; DEBUG_r( PerlIO_printf(Perl_debug_log, - "Trying /^/m starting at offset %ld...\n", - (long)(t - i_strpos)) ); + "Looking for /%s^%s/m starting at offset %ld...\n", + PL_colors[0],PL_colors[1], (long)(t - i_strpos)) ); goto try_at_offset; } if (!prog->float_substr) /* Could have been deleted */ @@ -1432,9 +1446,14 @@ /* we have /x+whatever/ */ /* it must be a one character string (XXXX Except UTF?) */ char ch = SvPVX(prog->anchored_substr)[0]; +#ifdef DEBUGGING + int did_match = 0; +#endif + if (UTF) { while (s < strend) { if (*s == ch) { + DEBUG_r( did_match = 1 ); if (regtry(prog, s)) goto got_it; s += UTF8SKIP(s); while (s < strend && *s == ch) @@ -1446,6 +1465,7 @@ else { while (s < strend) { if (*s == ch) { + DEBUG_r( did_match = 1 ); if (regtry(prog, s)) goto got_it; s++; while (s < strend && *s == ch) @@ -1454,6 +1474,9 @@ s++; } } + DEBUG_r(did_match || + PerlIO_printf(Perl_debug_log, + "Did not find anchored character...\n")); } /*SUPPRESS 560*/ else if (prog->anchored_substr != Nullsv @@ -1469,6 +1492,9 @@ -(I32)(CHR_SVLEN(must) - (SvTAIL(must) != 0) + back_min)); char *last1; /* Last position checked before */ +#ifdef DEBUGGING + int did_match = 0; +#endif if (s > PL_bostr) last1 = HOPc(s, -1); @@ -1487,6 +1513,7 @@ : (s = fbm_instr((unsigned char*)HOP(s, back_min), (unsigned char*)strend, must, PL_multiline ? FBMrf_MULTILINE : 0))) ) { + DEBUG_r( did_match = 1 ); if (HOPc(s, -back_max) > last1) { last1 = HOPc(s, -back_min); s = HOPc(s, -back_max); @@ -1512,6 +1539,14 @@ } } } + DEBUG_r(did_match || + PerlIO_printf(Perl_debug_log, "Did not find %s substr `%s%.*s%s'%s...\n", + ((must == prog->anchored_substr) + ? "anchored" : "floating"), + PL_colors[0], + (int)(SvCUR(must) - (SvTAIL(must)!=0)), + SvPVX(must), + PL_colors[1], (SvTAIL(must) ? "$" : ""))); goto phooey; } else if ((c = prog->regstclass)) { @@ -1520,6 +1555,7 @@ strend = HOPc(strend, -(minlen - 1)); if (find_byclass(prog, c, s, strend, startpos, 0)) goto got_it; + DEBUG_r(PerlIO_printf(Perl_debug_log, "Contradicts stclass...\n")); } else { dontbother = 0; @@ -1552,7 +1588,12 @@ last = strend; /* matching `$' */ } } - if (last == NULL) goto phooey; /* Should not happen! */ + if (last == NULL) { + DEBUG_r(PerlIO_printf(Perl_debug_log, + "%sCan't trim the tail, match fails (should not happen)%s\n", + PL_colors[4],PL_colors[5])); + goto phooey; /* Should not happen! */ + } dontbother = strend - last + prog->float_min_offset; } if (minlen && (dontbother < minlen)) @@ -1614,6 +1655,8 @@ return 1; phooey: + DEBUG_r(PerlIO_printf(Perl_debug_log, "%sMatch failed%s\n", + PL_colors[4],PL_colors[5])); if (PL_reg_eval_set) restore_pos(aTHXo_ 0); return 0; @@ -1838,7 +1881,7 @@ } sayNO; case SBOL: - if (locinput == PL_regbol && PL_regprev == '\n') + if (locinput == PL_bostr) break; sayNO; case GPOS: diff -ruN perl-5.6.0/scope.c AP615_source/scope.c --- perl-5.6.0/scope.c Wed Jul 5 14:34:39 2000 +++ AP615_source/scope.c Thu Jun 29 08:37:05 2000 @@ -249,7 +249,7 @@ return save_scalar_at(sptr); } -/* Like save_svref(), but doesn't deal with magic. Can be used to +/* Like save_sptr(), but also SvREFCNT_dec()s the new value. Can be used to * restore a global SV to its prior contents, freeing new value. */ void Perl_save_generic_svref(pTHX_ SV **sptr) @@ -261,6 +261,19 @@ SSPUSHINT(SAVEt_GENERIC_SVREF); } +/* Like save_pptr(), but also Safefree()s the new value if it is different + * from the old one. Can be used to restore a global char* to its prior + * contents, freeing new value. */ +void +Perl_save_generic_pvref(pTHX_ char **str) +{ + dTHR; + SSCHECK(3); + SSPUSHPTR(str); + SSPUSHPTR(*str); + SSPUSHINT(SAVEt_GENERIC_PVREF); +} + void Perl_save_gp(pTHX_ GV *gv, I32 empty) { @@ -646,6 +659,7 @@ register AV *av; register HV *hv; register void* ptr; + register char* str; I32 i; if (base < -1) @@ -666,14 +680,20 @@ ptr = &GvSV(gv); SvREFCNT_dec(gv); goto restore_sv; + case SAVEt_GENERIC_PVREF: /* generic pv */ + str = (char*)SSPOPPTR; + ptr = SSPOPPTR; + if (*(char**)ptr != str) { + Safefree(*(char**)ptr); + *(char**)ptr = str; + } + break; case SAVEt_GENERIC_SVREF: /* generic sv */ value = (SV*)SSPOPPTR; ptr = SSPOPPTR; - if (ptr) { - sv = *(SV**)ptr; - *(SV**)ptr = value; - SvREFCNT_dec(sv); - } + sv = *(SV**)ptr; + *(SV**)ptr = value; + SvREFCNT_dec(sv); SvREFCNT_dec(value); break; case SAVEt_SVREF: /* scalar reference */ diff -ruN perl-5.6.0/scope.h AP615_source/scope.h --- perl-5.6.0/scope.h Wed Jul 5 14:34:39 2000 +++ AP615_source/scope.h Thu Jun 29 08:37:05 2000 @@ -32,6 +32,7 @@ #define SAVEt_VPTR 31 #define SAVEt_I8 32 #define SAVEt_COMPPAD 33 +#define SAVEt_GENERIC_PVREF 34 #define SSCHECK(need) if (PL_savestack_ix + need > PL_savestack_max) savestack_grow() #define SSPUSHINT(i) (PL_savestack[PL_savestack_ix++].any_i32 = (I32)(i)) @@ -105,6 +106,7 @@ #define SAVEFREEPV(p) save_freepv(SOFT_CAST(char*)(p)) #define SAVECLEARSV(sv) save_clearsv(SOFT_CAST(SV**)&(sv)) #define SAVEGENERICSV(s) save_generic_svref((SV**)&(s)) +#define SAVEGENERICPV(s) save_generic_pvref((char**)&(s)) #define SAVEDELETE(h,k,l) \ save_delete(SOFT_CAST(HV*)(h), SOFT_CAST(char*)(k), (I32)(l)) #define SAVEDESTRUCTOR(f,p) \ @@ -147,14 +149,18 @@ } STMT_END #ifdef USE_ITHREADS -# define SAVECOPSTASH(cop) SAVEPPTR(CopSTASHPV(cop)) -# define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop)) +# define SAVECOPSTASH(c) SAVEPPTR(CopSTASHPV(c)) +# define SAVECOPSTASH_FREE(c) SAVEGENERICPV(CopSTASHPV(c)) +# define SAVECOPFILE(c) SAVEPPTR(CopFILE(c)) +# define SAVECOPFILE_FREE(c) SAVEGENERICPV(CopFILE(c)) #else -# define SAVECOPSTASH(cop) SAVESPTR(CopSTASH(cop)) -# define SAVECOPFILE(cop) SAVESPTR(CopFILEGV(cop)) +# define SAVECOPSTASH(c) SAVESPTR(CopSTASH(c)) +# define SAVECOPSTASH_FREE(c) SAVECOPSTASH(c) /* XXX not refcounted */ +# define SAVECOPFILE(c) SAVESPTR(CopFILEGV(c)) +# define SAVECOPFILE_FREE(c) SAVEGENERICSV(CopFILEGV(c)) #endif -#define SAVECOPLINE(cop) SAVEI16(CopLINE(cop)) +#define SAVECOPLINE(c) SAVEI16(CopLINE(c)) /* SSNEW() temporarily allocates a specified number of bytes of data on the * savestack. It returns an integer index into the savestack, because a diff -ruN perl-5.6.0/sv.c AP615_source/sv.c --- perl-5.6.0/sv.c Wed Jul 5 14:34:40 2000 +++ AP615_source/sv.c Thu Jun 29 08:37:05 2000 @@ -1483,8 +1483,8 @@ if (SvTYPE(sv) < SVt_PVIV) sv_upgrade(sv, SVt_PVIV); - SvIVX(sv) = 0; (void)SvIOK_on(sv); + SvIVX(sv) = 0; if (ckWARN(WARN_NUMERIC)) not_a_number(sv); } @@ -1637,10 +1637,10 @@ if (SvTYPE(sv) < SVt_PVIV) sv_upgrade(sv, SVt_PVIV); - SvUVX(sv) = 0; /* We assume that 0s have the - same bitmap in IV and UV. */ (void)SvIOK_on(sv); (void)SvIsUV_on(sv); + SvUVX(sv) = 0; /* We assume that 0s have the + same bitmap in IV and UV. */ if (ckWARN(WARN_NUMERIC)) not_a_number(sv); } @@ -2724,7 +2724,7 @@ if (sflags & SVp_IOK) { (void)SvIOK_on(dstr); SvIVX(dstr) = SvIVX(sstr); - if (SvIsUV(sstr)) + if (sflags & SVf_IVisUV) SvIsUV_on(dstr); } if (SvAMAGIC(sstr)) { @@ -2756,13 +2756,9 @@ SvPV_set(dstr, SvPVX(sstr)); SvLEN_set(dstr, SvLEN(sstr)); SvCUR_set(dstr, SvCUR(sstr)); - if (SvUTF8(sstr)) - SvUTF8_on(dstr); - else - SvUTF8_off(dstr); SvTEMP_off(dstr); - (void)SvOK_off(sstr); + (void)SvOK_off(sstr); /* NOTE: nukes most SvFLAGS on sstr */ SvPV_set(sstr, Nullch); SvLEN_set(sstr, 0); SvCUR_set(sstr, 0); @@ -2777,7 +2773,7 @@ *SvEND(dstr) = '\0'; (void)SvPOK_only(dstr); } - if (DO_UTF8(sstr)) + if ((sflags & SVf_UTF8) && !IN_BYTE) SvUTF8_on(dstr); /*SUPPRESS 560*/ if (sflags & SVp_NOK) { @@ -2787,25 +2783,25 @@ if (sflags & SVp_IOK) { (void)SvIOK_on(dstr); SvIVX(dstr) = SvIVX(sstr); - if (SvIsUV(sstr)) + if (sflags & SVf_IVisUV) SvIsUV_on(dstr); } } else if (sflags & SVp_NOK) { SvNVX(dstr) = SvNVX(sstr); (void)SvNOK_only(dstr); - if (SvIOK(sstr)) { + if (sflags & SVf_IOK) { (void)SvIOK_on(dstr); SvIVX(dstr) = SvIVX(sstr); /* XXXX Do we want to set IsUV for IV(ROK)? Be extra safe... */ - if (SvIsUV(sstr)) + if (sflags & SVf_IVisUV) SvIsUV_on(dstr); } } else if (sflags & SVp_IOK) { (void)SvIOK_only(dstr); SvIVX(dstr) = SvIVX(sstr); - if (SvIsUV(sstr)) + if (sflags & SVf_IVisUV) SvIsUV_on(dstr); } else { @@ -3090,11 +3086,13 @@ if (!sstr) return; if ((s = SvPV(sstr, len))) { - if (SvUTF8(sstr)) + if (DO_UTF8(sstr)) { sv_utf8_upgrade(dstr); - sv_catpvn(dstr,s,len); - if (SvUTF8(sstr)) + sv_catpvn(dstr,s,len); SvUTF8_on(dstr); + } + else + sv_catpvn(dstr,s,len); } } @@ -3451,6 +3449,7 @@ if (!bigstr) Perl_croak(aTHX_ "Can't modify non-existent substring"); SvPV_force(bigstr, curlen); + (void)SvPOK_only_UTF8(bigstr); if (offset + len > curlen) { SvGROW(bigstr, offset+len+1); Zero(SvPVX(bigstr)+curlen, offset+len-curlen, char); @@ -3920,10 +3919,19 @@ else pv1 = SvPV(str1, cur1); - if (!str2) - return !cur1; - else - pv2 = SvPV(str2, cur2); + if (cur1) { + if (!str2) + return 0; + if (SvUTF8(str1) != SvUTF8(str2) && !IN_BYTE) { + if (SvUTF8(str1)) { + sv_utf8_upgrade(str2); + } + else { + sv_utf8_upgrade(str1); + } + } + } + pv2 = SvPV(str2, cur2); if (cur1 != cur2) return 0; @@ -7126,6 +7134,12 @@ gv = (GV*)POPPTR(ss,ix); TOPPTR(nss,ix) = gv_dup_inc(gv); break; + case SAVEt_GENERIC_PVREF: /* generic char* */ + c = (char*)POPPTR(ss,ix); + TOPPTR(nss,ix) = pv_dup(c); + ptr = POPPTR(ss,ix); + TOPPTR(nss,ix) = any_dup(ptr, proto_perl); + break; case SAVEt_GENERIC_SVREF: /* generic sv */ case SAVEt_SVREF: /* scalar reference */ sv = (SV*)POPPTR(ss,ix); @@ -7856,6 +7870,7 @@ } else { init_stacks(); + ENTER; /* perl_destruct() wants to LEAVE; */ } PL_start_env = proto_perl->Tstart_env; /* XXXXXX */ diff -ruN perl-5.6.0/t/comp/proto.t AP615_source/t/comp/proto.t --- perl-5.6.0/t/comp/proto.t Wed Jul 5 14:34:40 2000 +++ AP615_source/t/comp/proto.t Thu Jun 29 08:28:27 2000 @@ -16,7 +16,7 @@ use strict; -print "1..107\n"; +print "1..110\n"; my $i = 1; @@ -286,6 +286,25 @@ @array = ( \&tmp_sub_1 ); eval 'a_sub @array'; +print "not " unless $@; +printf "ok %d\n",$i++; + +## +## +## + +testing \&a_subx, '\&'; + +sub a_subx (\&) { + print "# \@_ = (",join(",",@_),")\n"; + &{$_[0]}; +} + +sub tmp_sub_2 { printf "ok %d\n",$i++ } +a_subx &tmp_sub_2; + +@array = ( \&tmp_sub_2 ); +eval 'a_subx @array'; print "not " unless $@; printf "ok %d\n",$i++; diff -ruN perl-5.6.0/t/lib/charnames.t AP615_source/t/lib/charnames.t --- perl-5.6.0/t/lib/charnames.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/charnames.t Thu Jun 29 08:27:09 2000 @@ -42,15 +42,21 @@ $encoded_be = "\320\261"; $encoded_alpha = "\316\261"; $encoded_bet = "\327\221"; + +sub to_bytes { + use bytes; + my $bytes = shift; +} + { use charnames ':full'; - print "not " unless "\N{CYRILLIC SMALL LETTER BE}" eq $encoded_be; + print "not " unless to_bytes("\N{CYRILLIC SMALL LETTER BE}") eq $encoded_be; print "ok 4\n"; use charnames qw(cyrillic greek :short); - print "not " unless "\N{be},\N{alpha},\N{hebrew:bet}" + print "not " unless to_bytes("\N{be},\N{alpha},\N{hebrew:bet}") eq "$encoded_be,$encoded_alpha,$encoded_bet"; print "ok 5\n"; } diff -ruN perl-5.6.0/t/lib/dumper.t AP615_source/t/lib/dumper.t --- perl-5.6.0/t/lib/dumper.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/dumper.t Thu Jun 29 08:28:46 2000 @@ -287,7 +287,7 @@ package main; use Data::Dumper; $foo = 5; - @foo = (10,\*foo); + @foo = (-10,\*foo); %foo = (a=>1,b=>\$foo,c=>\@foo); $foo{d} = \%foo; $foo[2] = \%foo; @@ -299,7 +299,7 @@ #*::foo = \5; #*::foo = [ # #0 -# 10, +# -10, # #1 # do{my $o}, # #2 @@ -330,7 +330,7 @@ #$foo = \*::foo; #*::foo = \5; #*::foo = [ -# 10, +# -10, # do{my $o}, # { # 'a' => 1, @@ -356,7 +356,7 @@ ## $WANT = <<'EOT'; #@bar = ( -# 10, +# -10, # \*::foo, # {} #); @@ -383,7 +383,7 @@ ## $WANT = <<'EOT'; #$bar = [ -# 10, +# -10, # \*::foo, # {} #]; @@ -411,7 +411,7 @@ $WANT = <<'EOT'; #$foo = \*::foo; #@bar = ( -# 10, +# -10, # $foo, # { # a => 1, @@ -433,7 +433,7 @@ $WANT = <<'EOT'; #$foo = \*::foo; #$bar = [ -# 10, +# -10, # $foo, # { # a => 1, diff -ruN perl-5.6.0/t/lib/filefind.t AP615_source/t/lib/filefind.t --- perl-5.6.0/t/lib/filefind.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/filefind.t Thu Jun 29 08:36:42 2000 @@ -19,6 +19,7 @@ my $case = 2; +my $FastFileTests_OK = 0; END { unlink 'fa/fa_ord','fa/fsl','fa/faa/faa_ord', @@ -57,8 +58,15 @@ print "# '$_' => 1\n"; s#\.$## if ($^O eq 'VMS' && $_ ne '.'); Check( $Expect{$_} ); - delete $Expect{$_}; + if ( $FastFileTests_OK ) { + delete $Expect{$_} + unless ( $Expect_Dir{$_} && ! -d _ ); + } else { + delete $Expect{$_} + unless ( $Expect_Dir{$_} && ! -d $_ ); + } $File::Find::prune=1 if $_ eq 'faba'; + } sub dn_wanted { @@ -106,6 +114,9 @@ %Expect = ('.' => 1, 'fsl' => 1, 'fa_ord' => 1, 'fab' => 1, 'fab_ord' => 1, 'faba' => 1, 'faa' => 1, 'faa_ord' => 1); delete $Expect{'fsl'} unless $symlink_exists; +%Expect_Dir = ('fa' => 1, 'faa' => 1, 'fab' => 1, 'faba' => 1, + 'fb' => 1, 'fba' => 1); +delete @Expect_Dir{'fb','fba'} unless $symlink_exists; File::Find::find( {wanted => \&wanted, },'fa' ); Check( scalar(keys %Expect) == 0 ); @@ -113,6 +124,9 @@ 'fa/fab/fab_ord' => 1, 'fa/fab/faba' => 1, 'fa/fab/faba/faba_ord' => 1, 'fa/faa' => 1, 'fa/faa/faa_ord' => 1); delete $Expect{'fa/fsl'} unless $symlink_exists; +%Expect_Dir = ('fa' => 1, 'fa/faa' => 1, '/fa/fab' => 1, 'fa/fab/faba' => 1, + 'fb' => 1, 'fb/fba' => 1); +delete @Expect_Dir{'fb','fb/fba'} unless $symlink_exists; File::Find::find( {wanted => \&wanted, no_chdir => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); @@ -122,6 +136,9 @@ './fa/fab/faba/faba_ord' => 1, './fa/faa' => 1, './fa/faa/faa_ord' => 1, './fb' => 1, './fb/fba' => 1, './fb/fba/fba_ord' => 1, './fb/fb_ord' => 1); delete $Expect{'./fa/fsl'} unless $symlink_exists; +%Expect_Dir = ('./fa' => 1, './fa/faa' => 1, '/fa/fab' => 1, './fa/fab/faba' => 1, + './fb' => 1, './fb/fba' => 1); +delete @Expect_Dir{'./fb','./fb/fba'} unless $symlink_exists; File::Find::finddepth( {wanted => \&dn_wanted },'.' ); Check( scalar(keys %Expect) == 0 ); @@ -130,13 +147,19 @@ './fa/fab/faba/faba_ord' => 1, './fa/faa' => 1, './fa/faa/faa_ord' => 1, './fb' => 1, './fb/fba' => 1, './fb/fba/fba_ord' => 1, './fb/fb_ord' => 1); delete $Expect{'./fa/fsl'} unless $symlink_exists; +%Expect_Dir = ('./fa' => 1, './fa/faa' => 1, '/fa/fab' => 1, './fa/fab/faba' => 1, + './fb' => 1, './fb/fba' => 1); +delete @Expect_Dir{'./fb','./fb/fba'} unless $symlink_exists; File::Find::finddepth( {wanted => \&d_wanted, no_chdir => 1 },'.' ); Check( scalar(keys %Expect) == 0 ); if ( $symlink_exists ) { + $FastFileTests_OK= 1; %Expect=('.' => 1, 'fa_ord' => 1, 'fsl' => 1, 'fb_ord' => 1, 'fba' => 1, 'fba_ord' => 1, 'fab' => 1, 'fab_ord' => 1, 'faba' => 1, 'faa' => 1, 'faa_ord' => 1); + %Expect_Dir = ('fa' => 1, 'fa/faa' => 1, '/fa/fab' => 1, 'fa/fab/faba' => 1, + 'fb' => 1, 'fb/fba' => 1); File::Find::find( {wanted => \&wanted, follow_fast => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); @@ -145,6 +168,8 @@ 'fa/fsl/fba' => 1, 'fa/fsl/fba/fba_ord' => 1, 'fa/fab' => 1, 'fa/fab/fab_ord' => 1, 'fa/fab/faba' => 1, 'fa/fab/faba/faba_ord' => 1, 'fa/faa' => 1, 'fa/faa/faa_ord' => 1); + %Expect_Dir = ('fa' => 1, 'fa/faa' => 1, '/fa/fab' => 1, 'fa/fab/faba' => 1, + 'fb' => 1, 'fb/fba' => 1); File::Find::find( {wanted => \&wanted, follow_fast => 1, no_chdir => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); @@ -152,6 +177,8 @@ 'fa/fsl/fba' => 1, 'fa/fsl/fba/fba_ord' => 1, 'fa/fab' => 1, 'fa/fab/fab_ord' => 1, 'fa/fab/faba' => 1, 'fa/fab/faba/faba_ord' => 1, 'fa/faa' => 1, 'fa/faa/faa_ord' => 1); + %Expect_Dir = ('fa' => 1, 'fa/faa' => 1, '/fa/fab' => 1, 'fa/fab/faba' => 1, + 'fb' => 1, 'fb/fba' => 1); File::Find::finddepth( {wanted => \&dn_wanted, follow_fast => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); @@ -160,6 +187,8 @@ 'fa/fsl/fba' => 1, 'fa/fsl/fba/fba_ord' => 1, 'fa/fab' => 1, 'fa/fab/fab_ord' => 1, 'fa/fab/faba' => 1, 'fa/fab/faba/faba_ord' => 1, 'fa/faa' => 1, 'fa/faa/faa_ord' => 1); + %Expect_Dir = ('fa' => 1, 'fa/faa' => 1, '/fa/fab' => 1, 'fa/fab/faba' => 1, + 'fb' => 1, 'fb/fba' => 1); File::Find::finddepth( {wanted => \&d_wanted, follow_fast => 1, no_chdir => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); diff -ruN perl-5.6.0/t/lib/glob-basic.t AP615_source/t/lib/glob-basic.t --- perl-5.6.0/t/lib/glob-basic.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/glob-basic.t Thu Jun 29 08:29:14 2000 @@ -44,7 +44,7 @@ ($name, $home) = (getpwuid($>))[0,7]; 1; } and do { - @a = File::Glob::glob("~$name", GLOB_TILDE); + @a = bsd_glob("~$name", GLOB_TILDE); if (scalar(@a) != 1 || $a[0] ne $home || GLOB_ERROR) { print "not "; } @@ -54,7 +54,7 @@ # check backslashing # should return a list with one item, and not set ERROR -@a = File::Glob::glob('TEST', GLOB_QUOTE); +@a = bsd_glob('TEST', GLOB_QUOTE); if (scalar @a != 1 || $a[0] ne 'TEST' || GLOB_ERROR) { local $/ = "]["; print "# [@a]\n"; @@ -65,7 +65,7 @@ # check nonexistent checks # should return an empty list # XXX since errfunc is NULL on win32, this test is not valid there -@a = File::Glob::glob("asdfasdf", 0); +@a = bsd_glob("asdfasdf", 0); if ($^O ne 'MSWin32' and scalar @a != 0) { print "# |@a|\nnot "; } @@ -81,7 +81,7 @@ else { $dir = "PtEeRsLt.dir"; mkdir $dir, 0; - @a = File::Glob::glob("$dir/*", GLOB_ERR); + @a = bsd_glob("$dir/*", GLOB_ERR); #print "\@a = ", array(@a); rmdir $dir; if (scalar(@a) != 0 || GLOB_ERROR == 0) { @@ -91,13 +91,13 @@ } # check for csh style globbing -@a = File::Glob::glob('{a,b}', GLOB_BRACE | GLOB_NOMAGIC); +@a = bsd_glob('{a,b}', GLOB_BRACE | GLOB_NOMAGIC); unless (@a == 2 and $a[0] eq 'a' and $a[1] eq 'b') { print "not "; } print "ok 7\n"; -@a = File::Glob::glob( +@a = bsd_glob( '{TES*,doesntexist*,a,b}', GLOB_BRACE | GLOB_NOMAGIC ); @@ -112,7 +112,7 @@ # "~" should expand to $ENV{HOME} $ENV{HOME} = "sweet home"; -@a = File::Glob::glob('~', GLOB_TILDE | GLOB_NOMAGIC); +@a = bsd_glob('~', GLOB_TILDE | GLOB_NOMAGIC); unless (@a == 1 and $a[0] eq $ENV{HOME}) { print "not "; } diff -ruN perl-5.6.0/t/lib/glob-case.t AP615_source/t/lib/glob-case.t --- perl-5.6.0/t/lib/glob-case.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/glob-case.t Thu Jun 29 08:29:14 2000 @@ -30,7 +30,7 @@ print "ok 3\n"; # Test the explicit use of the GLOB_NOCASE flag -@a = File::Glob::glob("lib/G*.t", GLOB_NOCASE); +@a = bsd_glob("lib/G*.t", GLOB_NOCASE); print "not " unless @a >= 3; print "ok 4\n"; @@ -47,7 +47,7 @@ rmdir "[]"; print "# returned @a\nnot " unless @a == 1; print "ok 6\n"; - @a = File::Glob::glob("lib\\*", GLOB_QUOTE); + @a = bsd_glob("lib\\*", GLOB_QUOTE); print "not " if @a == 0; print "ok 7\n"; } diff -ruN perl-5.6.0/t/lib/glob-taint.t AP615_source/t/lib/glob-taint.t --- perl-5.6.0/t/lib/glob-taint.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/glob-taint.t Thu Jun 29 08:29:14 2000 @@ -18,7 +18,7 @@ print "ok 1\n"; # all filenames should be tainted -@a = File::Glob::glob("*"); +@a = File::Glob::bsd_glob("*"); eval { $a = join("",@a), kill 0; 1 }; unless ($@ =~ /Insecure dependency/) { print "not "; diff -ruN perl-5.6.0/t/lib/io_poll.t AP615_source/t/lib/io_poll.t --- perl-5.6.0/t/lib/io_poll.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/io_poll.t Thu Jun 29 08:30:23 2000 @@ -15,7 +15,7 @@ select(STDERR); $| = 1; select(STDOUT); $| = 1; -print "1..8\n"; +print "1..9\n"; use IO::Handle; use IO::Poll qw(/POLL/); @@ -75,3 +75,8 @@ print "not " if $poll->events($stdout); print "ok 8\n"; + +$poll->remove($dupout); +print "not " + if $poll->handles; +print "ok 9\n"; diff -ruN perl-5.6.0/t/lib/open3.t AP615_source/t/lib/open3.t --- perl-5.6.0/t/lib/open3.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/lib/open3.t Thu Jun 29 08:30:35 2000 @@ -20,7 +20,7 @@ use IPC::Open3; #require 'open3.pl'; use subs 'open3'; -my $perl = './perl'; +my $perl = $^X; sub ok { my ($n, $result, $info) = @_; diff -ruN perl-5.6.0/t/lib/syslog.t AP615_source/t/lib/syslog.t --- perl-5.6.0/t/lib/syslog.t Wed Dec 31 16:00:00 1969 +++ AP615_source/t/lib/syslog.t Thu Jun 29 08:30:30 2000 @@ -0,0 +1,28 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; + require Config; import Config; + if ($Config{'extensions'} !~ /\bSyslog\b/) { + print "1..0 # Skip: Sys::Syslog was not built\n"; + exit 0; + } +} + +use Sys::Syslog qw(:DEFAULT setlogsock); + +print "1..6\n"; + +if (Sys::Syslog::_PATH_LOG()) { + print defined(eval { setlogsock('unix') }) ? "ok 1\n" : "not ok 1\n"; + print defined(eval { openlog('perl', 'ndelay', 'local0') }) ? "ok 2\n" : "not ok 2\n"; + print defined(eval { syslog('info', 'test') }) ? "ok 3\n" : "not ok 3\n"; +} +else { + for (1..3) { print "ok $_ # skipping, _PATH_LOG unavailable\n" } +} + +print defined(eval { setlogsock('inet') }) ? "ok 4\n" : "not ok 4\n"; +print defined(eval { openlog('perl', 'ndelay', 'local0') }) ? "ok 5\n" : "not ok 5\n"; +print defined(eval { syslog('info', 'test') }) ? "ok 6\n" : "not ok 6\n"; diff -ruN perl-5.6.0/t/op/arith.t AP615_source/t/op/arith.t --- perl-5.6.0/t/op/arith.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/op/arith.t Thu Jun 29 08:36:49 2000 @@ -1,6 +1,6 @@ #!./perl -print "1..8\n"; +print "1..12\n"; sub try ($$) { print +($_[1] ? "ok" : "not ok"), " $_[0]\n"; @@ -21,3 +21,10 @@ try 6, abs(-13e21 % 4e21 - 3e21) < $limit; try 7, abs( 13e21 % -4e21 - -3e21) < $limit; try 8, abs(-13e21 % -4e21 - -1e21) < $limit; + +# UVs should behave properly + +try 9, 4063328477 % 65535 == 27407; +try 10, 4063328477 % 4063328476 == 1; +try 11, 4063328477 % 2031664238 == 1; +try 12, 2031664238 % 4063328477 == 2031664238; diff -ruN perl-5.6.0/t/op/array.t AP615_source/t/op/array.t --- perl-5.6.0/t/op/array.t Wed Jul 5 14:34:41 2000 +++ AP615_source/t/op/array.t Thu Jun 29 08:29:34 2000 @@ -139,8 +139,8 @@ @foo = ('XXX',@foo, 'YYY'); t("@foo" eq "XXX bar burbl blah YYY"); # 40 -@foo = @foo = qw(foo bar burbl blah); -t("@foo" eq "foo bar burbl blah"); # 41 +@foo = @foo = qw(foo b\a\r bu\\rbl blah); +t("@foo" eq 'foo b\a\r bu\\rbl blah'); # 41 @bar = @foo = qw(foo bar); # 42 t("@foo" eq "foo bar"); diff -ruN perl-5.6.0/t/op/gv.t AP615_source/t/op/gv.t --- perl-5.6.0/t/op/gv.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/gv.t Thu Jun 29 08:33:12 2000 @@ -11,7 +11,7 @@ use warnings; -print "1..30\n"; +print "1..40\n"; # type coersion on assignment $foo = 'foo'; @@ -128,6 +128,42 @@ ++$test; &{$a}; } +# although it *should* if you're talking about magicals + +{ + my $test = 29; + + my $a = "]"; + print "not " unless defined ${$a}; + ++$test; print "ok $test\n"; + print "not " unless defined *{$a}; + ++$test; print "ok $test\n"; + + $a = "1"; + "o" =~ /(o)/; + print "not " unless ${$a}; + ++$test; print "ok $test\n"; + print "not " unless defined *{$a}; + ++$test; print "ok $test\n"; + $a = "2"; + print "not " if ${$a}; + ++$test; print "ok $test\n"; + print "not " unless defined *{$a}; + ++$test; print "ok $test\n"; + $a = "1x"; + print "not " if defined ${$a}; + ++$test; print "ok $test\n"; + print "not " if defined *{$a}; + ++$test; print "ok $test\n"; + $a = "11"; + "o" =~ /(((((((((((o)))))))))))/; + print "not " unless ${$a}; + ++$test; print "ok $test\n"; + print "not " unless defined *{$a}; + ++$test; print "ok $test\n"; +} + + # does pp_readline() handle glob-ness correctly? { @@ -137,4 +173,4 @@ } __END__ -ok 30 +ok 40 diff -ruN perl-5.6.0/t/op/misc.t AP615_source/t/op/misc.t --- perl-5.6.0/t/op/misc.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/misc.t Thu Jun 29 08:29:10 2000 @@ -545,3 +545,16 @@ lcfirst - world uc - WORLD lc - world +######## +sub f { my $a = 1; my $b = 2; my $c = 3; my $d = 4; next } +my $x = "foo"; +{ f } continue { print $x, "\n" } +EXPECT +foo +######## +sub C () { 1 } +sub M { $_[0] = 2; } +eval "C"; +M(C); +EXPECT +Modification of a read-only value attempted at - line 2. diff -ruN perl-5.6.0/t/op/oct.t AP615_source/t/op/oct.t --- perl-5.6.0/t/op/oct.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/oct.t Thu Jun 29 08:31:36 2000 @@ -1,53 +1,67 @@ #!./perl -print "1..36\n"; +print "1..44\n"; -print +(oct('0b10101') == 0b10101) ? "ok" : "not ok", " 1\n"; -print +(oct('0b10101') == 025) ? "ok" : "not ok", " 2\n"; -print +(oct('0b10101') == 21) ? "ok" : "not ok", " 3\n"; -print +(oct('0b10101') == 0x15) ? "ok" : "not ok", " 4\n"; - -print +(oct('b10101') == 0b10101) ? "ok" : "not ok", " 5\n"; -print +(oct('b10101') == 025) ? "ok" : "not ok", " 6\n"; -print +(oct('b10101') == 21) ? "ok" : "not ok", " 7\n"; -print +(oct('b10101') == 0x15) ? "ok" : "not ok", " 8\n"; - -print +(oct('01234') == 0b1010011100) ? "ok" : "not ok", " 9\n"; -print +(oct('01234') == 01234) ? "ok" : "not ok", " 10\n"; -print +(oct('01234') == 668) ? "ok" : "not ok", " 11\n"; +print +(oct('0b1_0101') == 0b101_01) ? "ok" : "not ok", " 1\n"; +print +(oct('0b10_101') == 0_2_5) ? "ok" : "not ok", " 2\n"; +print +(oct('0b101_01') == 2_1) ? "ok" : "not ok", " 3\n"; +print +(oct('0b1010_1') == 0x1_5) ? "ok" : "not ok", " 4\n"; + +print +(oct('b1_0101') == 0b10101) ? "ok" : "not ok", " 5\n"; +print +(oct('b10_101') == 025) ? "ok" : "not ok", " 6\n"; +print +(oct('b101_01') == 21) ? "ok" : "not ok", " 7\n"; +print +(oct('b1010_1') == 0x15) ? "ok" : "not ok", " 8\n"; + +print +(oct('01_234') == 0b10_1001_1100) ? "ok" : "not ok", " 9\n"; +print +(oct('012_34') == 01234) ? "ok" : "not ok", " 10\n"; +print +(oct('0123_4') == 668) ? "ok" : "not ok", " 11\n"; print +(oct('01234') == 0x29c) ? "ok" : "not ok", " 12\n"; -print +(oct('0x1234') == 0b1001000110100) ? "ok" : "not ok", " 13\n"; -print +(oct('0x1234') == 011064) ? "ok" : "not ok", " 14\n"; -print +(oct('0x1234') == 4660) ? "ok" : "not ok", " 15\n"; -print +(oct('0x1234') == 0x1234) ? "ok" : "not ok", " 16\n"; - -print +(oct('x1234') == 0b1001000110100) ? "ok" : "not ok", " 17\n"; -print +(oct('x1234') == 011064) ? "ok" : "not ok", " 18\n"; -print +(oct('x1234') == 4660) ? "ok" : "not ok", " 19\n"; -print +(oct('x1234') == 0x1234) ? "ok" : "not ok", " 20\n"; - -print +(hex('01234') == 0b1001000110100) ? "ok" : "not ok", " 21\n"; -print +(hex('01234') == 011064) ? "ok" : "not ok", " 22\n"; -print +(hex('01234') == 4660) ? "ok" : "not ok", " 23\n"; -print +(hex('01234') == 0x1234) ? "ok" : "not ok", " 24\n"; - -print +(hex('0x1234') == 0b1001000110100) ? "ok" : "not ok", " 25\n"; -print +(hex('0x1234') == 011064) ? "ok" : "not ok", " 26\n"; -print +(hex('0x1234') == 4660) ? "ok" : "not ok", " 27\n"; -print +(hex('0x1234') == 0x1234) ? "ok" : "not ok", " 28\n"; - -print +(hex('x1234') == 0b1001000110100) ? "ok" : "not ok", " 29\n"; -print +(hex('x1234') == 011064) ? "ok" : "not ok", " 30\n"; -print +(hex('x1234') == 4660) ? "ok" : "not ok", " 31\n"; -print +(hex('x1234') == 0x1234) ? "ok" : "not ok", " 32\n"; +print +(oct('0x1_234') == 0b10010_00110100) ? "ok" : "not ok", " 13\n"; +print +(oct('0x12_34') == 01_1064) ? "ok" : "not ok", " 14\n"; +print +(oct('0x123_4') == 4660) ? "ok" : "not ok", " 15\n"; +print +(oct('0x1234') == 0x12_34) ? "ok" : "not ok", " 16\n"; + +print +(oct('x1_234') == 0b100100011010_0) ? "ok" : "not ok", " 17\n"; +print +(oct('x12_34') == 0_11064) ? "ok" : "not ok", " 18\n"; +print +(oct('x123_4') == 4660) ? "ok" : "not ok", " 19\n"; +print +(oct('x1234') == 0x_1234) ? "ok" : "not ok", " 20\n"; + +print +(hex('01_234') == 0b_1001000110100) ? "ok" : "not ok", " 21\n"; +print +(hex('012_34') == 011064) ? "ok" : "not ok", " 22\n"; +print +(hex('0123_4') == 4660) ? "ok" : "not ok", " 23\n"; +print +(hex('01234_') == 0x1234) ? "ok" : "not ok", " 24\n"; + +print +(hex('0x_1234') == 0b1001000110100) ? "ok" : "not ok", " 25\n"; +print +(hex('0x1_234') == 011064) ? "ok" : "not ok", " 26\n"; +print +(hex('0x12_34') == 4660) ? "ok" : "not ok", " 27\n"; +print +(hex('0x1234_') == 0x1234) ? "ok" : "not ok", " 28\n"; + +print +(hex('x_1234') == 0b1001000110100) ? "ok" : "not ok", " 29\n"; +print +(hex('x12_34') == 011064) ? "ok" : "not ok", " 30\n"; +print +(hex('x123_4') == 4660) ? "ok" : "not ok", " 31\n"; +print +(hex('x1234_') == 0x1234) ? "ok" : "not ok", " 32\n"; -print +(oct('0b11111111111111111111111111111111') == 4294967295) ? +print +(oct('0b1111_1111_1111_1111_1111_1111_1111_1111') == 4294967295) ? "ok" : "not ok", " 33\n"; -print +(oct('037777777777') == 4294967295) ? +print +(oct('037_777_777_777') == 4294967295) ? "ok" : "not ok", " 34\n"; -print +(oct('0xffffffff') == 4294967295) ? +print +(oct('0xffff_ffff') == 4294967295) ? "ok" : "not ok", " 35\n"; -print +(hex('0xffffffff') == 4294967295) ? +print +(hex('0xff_ff_ff_ff') == 4294967295) ? "ok" : "not ok", " 36\n"; + +$_ = "\0_7_7"; +print length eq 5 ? "ok" : "not ok", " 37\n"; +print $_ eq "\0"."_"."7"."_"."7" ? "ok" : "not ok", " 38\n"; +chop, chop, chop, chop; +print $_ eq "\0" ? "ok" : "not ok", " 39\n"; +print "\077_" eq "?_" ? "ok" : "not ok", " 40\n"; + +$_ = "\x_7_7"; +print length eq 5 ? "ok" : "not ok", " 41\n"; +print $_ eq "\0"."_"."7"."_"."7" ? "ok" : "not ok", " 42\n"; +chop, chop, chop, chop; +print $_ eq "\0" ? "ok" : "not ok", " 43\n"; +print "\x2F_" eq "/_" ? "ok" : "not ok", " 44\n"; diff -ruN perl-5.6.0/t/op/pat.t AP615_source/t/op/pat.t --- perl-5.6.0/t/op/pat.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/pat.t Thu Jun 29 08:27:52 2000 @@ -4,7 +4,7 @@ # the format supported by op/regexp.t. If you want to add a test # that does fit that format, add it to op/re_tests, not here. -print "1..211\n"; +print "1..213\n"; BEGIN { chdir 't' if -d 't'; @@ -993,5 +993,22 @@ $test++; "\n\n" =~ /\n+ $ \n/x or print "not "; +print "ok $test\n"; +$test++; + +[] =~ /^ARRAY/ or print "# [] \nnot "; +print "ok $test\n"; +$test++; + +eval << 'EOE'; +{ + package S; + use overload '""' => sub { 'Object S' }; + sub new { bless [] } +} +$a = 'S'->new; +EOE + +$a and $a =~ /^Object\sS/ or print "# '$a' \nnot "; print "ok $test\n"; $test++; diff -ruN perl-5.6.0/t/op/quotemeta.t AP615_source/t/op/quotemeta.t --- perl-5.6.0/t/op/quotemeta.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/quotemeta.t Thu Jun 29 08:32:28 2000 @@ -6,14 +6,14 @@ require Config; import Config; } -print "1..15\n"; +print "1..17\n"; if ($Config{ebcdic} eq 'define') { $_=join "", map chr($_), 129..233; # 105 characters - 52 letters = 53 backslashes # 105 characters + 53 backslashes = 158 characters - $_=quotemeta $_; + $_= quotemeta $_; if ( length == 158 ){print "ok 1\n"} else {print "not ok 1\n"} # 104 non-backslash characters if (tr/\\//cd == 104){print "ok 2\n"} else {print "not ok 2\n"} @@ -22,7 +22,7 @@ # 96 characters - 52 letters - 10 digits - 1 underscore = 33 backslashes # 96 characters + 33 backslashes = 129 characters - $_=quotemeta $_; + $_= quotemeta $_; if ( length == 129 ){print "ok 1\n"} else {print "not ok 1\n"} # 95 non-backslash characters if (tr/\\//cd == 95){print "ok 2\n"} else {print "not ok 2\n"} @@ -42,3 +42,6 @@ print "\Q\l\UPe*x*r\El\E*" eq "pE\\*X\\*Rl*" ? "ok 13\n" : "not ok 13 \n"; print "\U\lPerl\E\E\E\E" eq "pERL" ? "ok 14\n" : "not ok 14 \n"; print "\l\UPerl\E\E\E\E" eq "pERL" ? "ok 15\n" : "not ok 15 \n"; + +print length(quotemeta("\x{263a}")) == 1 ? "ok 16\n" : "not ok 16\n"; +print quotemeta("\x{263a}") eq "\x{263a}" ? "ok 17\n" : "not ok 17\n"; diff -ruN perl-5.6.0/t/op/re_tests AP615_source/t/op/re_tests --- perl-5.6.0/t/op/re_tests Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/re_tests Thu Jun 29 08:36:45 2000 @@ -750,3 +750,5 @@ ^([a-z]:) C:/ n - - '^\S\s+aa$'m \nx aa y - - (^|a)b ab y - - +(?i) y - - +'(?!\A)x'm a\nxb\n y - - diff -ruN perl-5.6.0/t/op/readdir.t AP615_source/t/op/readdir.t --- perl-5.6.0/t/op/readdir.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/readdir.t Thu May 25 01:14:40 2000 @@ -10,11 +10,11 @@ print "1..3\n"; -for $i (1..2000) { - local *OP; - opendir(OP, "op") or die "can't opendir: $!"; - # should auto-closedir() here -} +#for $i (1..2000) { +# local *OP; +# opendir(OP, "op") or die "can't opendir: $!"; +# # should auto-closedir() here +#} if (opendir(OP, "op")) { print "ok 1\n"; } else { print "not ok 1\n"; } @D = grep(/^[^\.].*\.t$/i, readdir(OP)); diff -ruN perl-5.6.0/t/op/runlevel.t AP615_source/t/op/runlevel.t --- perl-5.6.0/t/op/runlevel.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/runlevel.t Thu Jun 29 08:38:15 2000 @@ -349,3 +349,18 @@ bar B 2 bar +######## +sub n { 0 } +sub f { my $x = shift; d(); } +f(n()); +f(); + +sub d { + my $i = 0; my @a; + while (do { { package DB; @a = caller($i++) } } ) { + @a = @DB::args; + for (@a) { print "$_\n"; $_ = '' } + } +} +EXPECT +0 diff -ruN perl-5.6.0/t/op/sort.t AP615_source/t/op/sort.t --- perl-5.6.0/t/op/sort.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/sort.t Thu Jun 29 08:29:01 2000 @@ -5,7 +5,7 @@ unshift @INC, '../lib'; } use warnings; -print "1..49\n"; +print "1..57\n"; # XXX known to leak scalars { @@ -270,3 +270,54 @@ @b = sort main::Backwards_stacked @a; print ("@b" eq '90 5 255 1996 19' ? "ok 49\n" : "not ok 49\n"); print "# x = '@b'\n"; + +# check if context for sort arguments is handled right + +$test = 49; +sub test_if_list { + my $gimme = wantarray; + print "not " unless $gimme; + ++$test; + print "ok $test\n"; +} +my $m = sub { $a <=> $b }; + +sub cxt_one { sort $m test_if_list() } +cxt_one(); +sub cxt_two { sort { $a <=> $b } test_if_list() } +cxt_two(); +sub cxt_three { sort &test_if_list() } +cxt_three(); + +sub test_if_scalar { + my $gimme = wantarray; + print "not " if $gimme or !defined($gimme); + ++$test; + print "ok $test\n"; +} + +$m = \&test_if_scalar; +sub cxt_four { sort $m 1,2 } +@x = cxt_four(); +sub cxt_five { sort { test_if_scalar($a,$b); } 1,2 } +@x = cxt_five(); +sub cxt_six { sort test_if_scalar 1,2 } +@x = cxt_six(); + +# test against a reentrancy bug +{ + package Bar; + sub compare { $a cmp $b } + sub reenter { my @force = sort compare qw/a b/ } +} +{ + my($def, $init) = (0, 0); + @b = sort { + $def = 1 if defined $Bar::a; + Bar::reenter() unless $init++; + $a <=> $b + } qw/4 3 1 2/; + print ("@b" eq '1 2 3 4' ? "ok 56\n" : "not ok 56\n"); + print "# x = '@b'\n"; + print !$def ? "ok 57\n" : "not ok 57\n"; +} diff -ruN perl-5.6.0/t/op/substr.t AP615_source/t/op/substr.t --- perl-5.6.0/t/op/substr.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/substr.t Thu Jun 29 08:32:35 2000 @@ -1,10 +1,12 @@ +#!./perl -print "1..125\n"; +print "1..135\n"; #P = start of string Q = start of substr R = end of substr S = end of string BEGIN { - unshift @INC, '../lib' if -d '../lib' ; + chdir 't' if -d 't'; + unshift @INC, '../lib'; } use warnings ; @@ -268,3 +270,30 @@ $a = "abcdefgh"; ok 124, sub { shift }->(substr($a, 0, 4, "xxxx")) eq 'abcd'; ok 125, $a eq 'xxxxefgh'; + +{ + my $y = 10; + $y = "2" . $y; + ok 126, $y+0 == 210; +} + +# utf8 sanity +{ + my $x = substr("a\x{263a}b",0); + ok 127, length($x) == 3; + $x = substr($x,1,1); + ok 128, $x eq "\x{263a}"; + $x = $x x 2; + ok 129, length($x) == 2; + substr($x,0,1) = "abcd"; + ok 130, $x eq "abcd\x{263a}"; + ok 131, length($x) == 5; + $x = reverse $x; + ok 132, length($x) == 5; + ok 133, $x eq "\x{263a}dcba"; + + my $z = 10; + $z = "21\x{263a}" . $z; + ok 134, length($z) == 5; + ok 135, $z eq "21\x{263a}10"; +} diff -ruN perl-5.6.0/t/op/universal.t AP615_source/t/op/universal.t --- perl-5.6.0/t/op/universal.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/universal.t Thu Jun 29 08:26:46 2000 @@ -6,9 +6,10 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib' if -d '../lib'; + $| = 1; } -print "1..73\n"; +print "1..80\n"; $a = {}; bless $a, "Bob"; @@ -28,6 +29,19 @@ $Alice::VERSION = 2.718; +{ + package Cedric; + our @ISA; + use base qw(Human); +} + +{ + package Programmer; + our $VERSION = 1.667; + + sub write_perl { 1 } +} + package main; my $i = 2; @@ -45,12 +59,34 @@ test ! $a->isa("Male"); +test ! $a->isa('Programmer'); + test $a->can("drink"); test $a->can("eat"); test ! $a->can("sleep"); +test (!Cedric->isa('Programmer')); + +test (Cedric->isa('Human')); + +push(@Cedric::ISA,'Programmer'); + +test (Cedric->isa('Programmer')); + +{ + package Alice; + base::->import('Programmer'); +} + +test $a->isa('Programmer'); +test $a->isa("Female"); + +@Cedric::ISA = qw(Bob); + +test (!Cedric->isa('Programmer')); + my $b = 'abc'; my @refs = qw(SCALAR SCALAR LVALUE GLOB ARRAY HASH CODE); my @vals = ( \$b, \3.14, \substr($b,1,1), \*b, [], {}, sub {} ); @@ -88,7 +124,7 @@ test $a->isa("UNIVERSAL"); -my $sub2 = join ' ', sort grep { defined &{"UNIVERSAL::$_"} } keys %UNIVERSAL::; +my $sub2 = join ' ', sort grep { defined &{"UNIVERSAL::$_"} } keys %UNIVERSAL::; # XXX import being here is really a bug if ('a' lt 'A') { test $sub2 eq "can import isa VERSION"; diff -ruN perl-5.6.0/t/op/vec.t AP615_source/t/op/vec.t --- perl-5.6.0/t/op/vec.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/vec.t Thu Jun 29 08:36:59 2000 @@ -1,8 +1,6 @@ #!./perl -# $RCSfile: vec.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:36 $ - -print "1..15\n"; +print "1..18\n"; print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n"; print length($foo) == 0 ? "ok 2\n" : "not ok 2\n"; @@ -25,3 +23,11 @@ print $Vec eq "\xba\xdd\xac\xab" ? "ok 14\n" : "not ok 14\n"; print vec($Vec, 0, 32) == 3135089835 ? "ok 15\n" : "not ok 15\n"; +# ensure vec() handles numericalness correctly +$foo = $bar = $baz = 0; +vec($foo = 0,0,1) = 1; +vec($bar = 0,1,1) = 1; +$baz = $foo | $bar; +print $foo eq "1" && $foo == 1 ? "ok 16\n" : "not ok 16\n"; +print $bar eq "2" && $bar == 2 ? "ok 17\n" : "not ok 17\n"; +print "$foo $bar $baz" eq "1 2 3" ? "ok 18\n" : "not ok 18\n"; diff -ruN perl-5.6.0/t/op/ver.t AP615_source/t/op/ver.t --- perl-5.6.0/t/op/ver.t Wed Jul 5 14:34:42 2000 +++ AP615_source/t/op/ver.t Thu Jun 29 08:26:59 2000 @@ -5,7 +5,7 @@ unshift @INC, "../lib"; } -print "1..22\n"; +print "1..23\n"; my $test = 1; @@ -70,6 +70,11 @@ print "not " unless sprintf("%*vb", "##", v1.22.333.4444) eq '1##10110##101001101##1000101011100'; +print "ok $test\n"; ++$test; + +print "not " unless sprintf("%vd", join("", map { chr } + unpack "U*", v2001.2002.2003)) + eq '2001.2002.2003'; print "ok $test\n"; ++$test; { diff -ruN perl-5.6.0/t/pragma/strict-vars AP615_source/t/pragma/strict-vars --- perl-5.6.0/t/pragma/strict-vars Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/strict-vars Thu Jun 29 08:35:39 2000 @@ -55,7 +55,7 @@ # strict vars - error use strict 'vars' ; -$fred ; +<$fred> ; EXPECT Global symbol "$fred" requires explicit package name at - line 4. Execution of - aborted due to compilation errors. @@ -387,6 +387,8 @@ # multiple our declarations in same scope, same package, warning use strict 'vars'; use warnings; +{ our $x = 1 } +{ our $x = 0 } our $foo; { our $foo; @@ -394,6 +396,6 @@ our $foo; } EXPECT -"our" variable $foo redeclared at - line 7. +"our" variable $foo redeclared at - line 9. (Did you mean "local" instead of "our"?) -Name "Foo::foo" used only once: possible typo at - line 9. +Name "Foo::foo" used only once: possible typo at - line 11. diff -ruN perl-5.6.0/t/pragma/utf8.t AP615_source/t/pragma/utf8.t --- perl-5.6.0/t/pragma/utf8.t Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/utf8.t Thu Jun 29 08:31:53 2000 @@ -10,7 +10,7 @@ } } -print "1..60\n"; +print "1..65\n"; my $test = 1; @@ -20,69 +20,77 @@ print "ok $test\n"; } +sub ok_bytes { + use bytes; + my ($got,$expect) = @_; + print "# expected [$expect], got [$got]\nnot " if $got ne $expect; + print "ok $test\n"; +} + + { use utf8; $_ = ">\x{263A}<"; s/([\x{80}-\x{10ffff}])/"&#".ord($1).";"/eg; ok $_, '>☺<'; - $test++; + $test++; # 1 $_ = ">\x{263A}<"; my $rx = "\x{80}-\x{10ffff}"; s/([$rx])/"&#".ord($1).";"/eg; ok $_, '>☺<'; - $test++; + $test++; # 2 $_ = ">\x{263A}<"; my $rx = "\\x{80}-\\x{10ffff}"; s/([$rx])/"&#".ord($1).";"/eg; ok $_, '>☺<'; - $test++; + $test++; # 3 $_ = "alpha,numeric"; m/([[:alpha:]]+)/; ok $1, 'alpha'; - $test++; + $test++; # 4 $_ = "alphaNUMERICstring"; m/([[:^lower:]]+)/; ok $1, 'NUMERIC'; - $test++; + $test++; # 5 $_ = "alphaNUMERICstring"; m/(\p{Ll}+)/; ok $1, 'alpha'; - $test++; + $test++; # 6 $_ = "alphaNUMERICstring"; m/(\p{Lu}+)/; ok $1, 'NUMERIC'; - $test++; + $test++; # 7 $_ = "alpha,numeric"; m/([\p{IsAlpha}]+)/; ok $1, 'alpha'; - $test++; + $test++; # 8 $_ = "alphaNUMERICstring"; m/([^\p{IsLower}]+)/; ok $1, 'NUMERIC'; - $test++; + $test++; # 9 $_ = "alpha123numeric456"; m/([\p{IsDigit}]+)/; ok $1, '123'; - $test++; + $test++; # 10 $_ = "alpha123numeric456"; m/([^\p{IsDigit}]+)/; ok $1, 'alpha'; - $test++; + $test++; # 11 $_ = ",123alpha,456numeric"; m/([\p{IsAlnum}]+)/; ok $1, '123alpha'; - $test++; + $test++; # 12 } { use utf8; @@ -90,80 +98,100 @@ $_ = "\x{263A}>\x{263A}\x{263A}"; ok length, 4; - $test++; + $test++; # 13 ok length((m/>(.)/)[0]), 1; - $test++; + $test++; # 14 ok length($&), 2; - $test++; + $test++; # 15 ok length($'), 1; - $test++; + $test++; # 16 ok length($`), 1; - $test++; + $test++; # 17 ok length($1), 1; - $test++; + $test++; # 18 ok length($tmp=$&), 2; - $test++; + $test++; # 19 ok length($tmp=$'), 1; - $test++; + $test++; # 20 ok length($tmp=$`), 1; - $test++; + $test++; # 21 ok length($tmp=$1), 1; - $test++; + $test++; # 22 + + { + use bytes; - ok $&, pack("C*", ord(">"), 0342, 0230, 0272); - $test++; + my $tmp = $&; + ok $tmp, pack("C*", ord(">"), 0342, 0230, 0272); + $test++; # 23 + + $tmp = $'; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 24 + + $tmp = $`; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 25 + + $tmp = $1; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 26 + } + + ok_bytes $&, pack("C*", ord(">"), 0342, 0230, 0272); + $test++; # 27 - ok $', pack("C*", 0342, 0230, 0272); - $test++; + ok_bytes $', pack("C*", 0342, 0230, 0272); + $test++; # 28 - ok $`, pack("C*", 0342, 0230, 0272); - $test++; + ok_bytes $`, pack("C*", 0342, 0230, 0272); + $test++; # 29 - ok $1, pack("C*", 0342, 0230, 0272); - $test++; + ok_bytes $1, pack("C*", 0342, 0230, 0272); + $test++; # 30 { use bytes; no utf8; ok length, 10; - $test++; + $test++; # 31 ok length((m/>(.)/)[0]), 1; - $test++; + $test++; # 32 ok length($&), 2; - $test++; + $test++; # 33 ok length($'), 5; - $test++; + $test++; # 34 ok length($`), 3; - $test++; + $test++; # 35 ok length($1), 1; - $test++; + $test++; # 36 ok $&, pack("C*", ord(">"), 0342); - $test++; + $test++; # 37 ok $', pack("C*", 0230, 0272, 0342, 0230, 0272); - $test++; + $test++; # 38 ok $`, pack("C*", 0342, 0230, 0272); - $test++; + $test++; # 39 ok $1, pack("C*", 0342); - $test++; + $test++; # 40 } @@ -174,80 +202,90 @@ } ok length, 10; - $test++; + $test++; # 41 ok length((m/>(.)/)[0]), 1; - $test++; + $test++; # 42 ok length($&), 2; - $test++; + $test++; # 43 ok length($'), 1; - $test++; + $test++; # 44 ok length($`), 1; - $test++; + $test++; # 45 ok length($1), 1; - $test++; + $test++; # 46 ok length($tmp=$&), 2; - $test++; + $test++; # 47 ok length($tmp=$'), 1; - $test++; + $test++; # 48 ok length($tmp=$`), 1; - $test++; + $test++; # 49 ok length($tmp=$1), 1; - $test++; - - ok $&, pack("C*", ord(">"), 0342, 0230, 0272); - $test++; - - ok $', pack("C*", 0342, 0230, 0272); - $test++; - - ok $`, pack("C*", 0342, 0230, 0272); - $test++; + $test++; # 50 - ok $1, pack("C*", 0342, 0230, 0272); - $test++; + { + use bytes; + my $tmp = $&; + ok $tmp, pack("C*", ord(">"), 0342, 0230, 0272); + $test++; # 51 + + $tmp = $'; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 52 + + $tmp = $`; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 53 + + $tmp = $1; + ok $tmp, pack("C*", 0342, 0230, 0272); + $test++; # 54 + } { use bytes; no utf8; ok length, 10; - $test++; + $test++; # 55 ok length((m/>(.)/)[0]), 1; - $test++; + $test++; # 56 ok length($&), 2; - $test++; + $test++; # 57 ok length($'), 5; - $test++; + $test++; # 58 ok length($`), 3; - $test++; + $test++; # 59 ok length($1), 1; - $test++; + $test++; # 60 ok $&, pack("C*", ord(">"), 0342); - $test++; + $test++; # 61 ok $', pack("C*", 0230, 0272, 0342, 0230, 0272); - $test++; + $test++; # 62 ok $`, pack("C*", 0342, 0230, 0272); - $test++; + $test++; # 63 ok $1, pack("C*", 0342); - $test++; + $test++; # 64 } + + ok "\x{ab}" =~ /^\x{ab}$/, 1; + $test++; # 65 } diff -ruN perl-5.6.0/t/pragma/warn/2use AP615_source/t/pragma/warn/2use --- perl-5.6.0/t/pragma/warn/2use Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/2use Thu Jun 29 08:28:08 2000 @@ -120,175 +120,223 @@ ######## # Check scope of pragma with eval -no warnings ; -eval { +use warnings; +{ + no warnings ; + eval { + my $b ; chop $b ; + }; print STDERR $@ ; my $b ; chop $b ; -}; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT ######## # Check scope of pragma with eval -no warnings ; -eval { - use warnings 'uninitialized' ; +use warnings; +{ + no warnings ; + eval { + use warnings 'uninitialized' ; + my $b ; chop $b ; + }; print STDERR $@ ; my $b ; chop $b ; -}; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT -Use of uninitialized value in scalar chop at - line 6. +Use of uninitialized value in scalar chop at - line 8. ######## # Check scope of pragma with eval -use warnings 'uninitialized' ; -eval { +no warnings; +{ + use warnings 'uninitialized' ; + eval { + my $b ; chop $b ; + }; print STDERR $@ ; my $b ; chop $b ; -}; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT -Use of uninitialized value in scalar chop at - line 5. Use of uninitialized value in scalar chop at - line 7. +Use of uninitialized value in scalar chop at - line 9. ######## # Check scope of pragma with eval -use warnings 'uninitialized' ; -eval { - no warnings ; +no warnings; +{ + use warnings 'uninitialized' ; + eval { + no warnings ; + my $b ; chop $b ; + }; print STDERR $@ ; my $b ; chop $b ; -}; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT -Use of uninitialized value in scalar chop at - line 8. +Use of uninitialized value in scalar chop at - line 10. ######## # Check scope of pragma with eval -no warnings ; -eval { +use warnings; +{ + no warnings ; + eval { + 1 if $a EQ $b ; + }; print STDERR $@ ; 1 if $a EQ $b ; -}; print STDERR $@ ; -1 if $a EQ $b ; +} EXPECT ######## # Check scope of pragma with eval -no warnings ; -eval { - use warnings 'deprecated' ; +use warnings; +{ + no warnings ; + eval { + use warnings 'deprecated' ; + 1 if $a EQ $b ; + }; print STDERR $@ ; 1 if $a EQ $b ; -}; print STDERR $@ ; -1 if $a EQ $b ; +} EXPECT -Use of EQ is deprecated at - line 6. +Use of EQ is deprecated at - line 8. ######## # Check scope of pragma with eval -use warnings 'deprecated' ; -eval { +no warnings; +{ + use warnings 'deprecated' ; + eval { + 1 if $a EQ $b ; + }; print STDERR $@ ; 1 if $a EQ $b ; -}; print STDERR $@ ; -1 if $a EQ $b ; +} EXPECT -Use of EQ is deprecated at - line 5. Use of EQ is deprecated at - line 7. +Use of EQ is deprecated at - line 9. ######## # Check scope of pragma with eval -use warnings 'deprecated' ; -eval { - no warnings ; +no warnings; +{ + use warnings 'deprecated' ; + eval { + no warnings ; + 1 if $a EQ $b ; + }; print STDERR $@ ; 1 if $a EQ $b ; -}; print STDERR $@ ; -1 if $a EQ $b ; +} EXPECT -Use of EQ is deprecated at - line 8. +Use of EQ is deprecated at - line 10. ######## # Check scope of pragma with eval -no warnings ; -eval ' +use warnings; +{ + no warnings ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; my $b ; chop $b ; -'; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT ######## # Check scope of pragma with eval -no warnings ; -eval q[ - use warnings 'uninitialized' ; +use warnings; +{ + no warnings ; + eval q[ + use warnings 'uninitialized' ; + my $b ; chop $b ; + ]; print STDERR $@; my $b ; chop $b ; -]; print STDERR $@; -my $b ; chop $b ; +} EXPECT Use of uninitialized value in scalar chop at (eval 1) line 3. ######## # Check scope of pragma with eval -use warnings 'uninitialized' ; -eval ' +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; my $b ; chop $b ; -'; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT Use of uninitialized value in scalar chop at (eval 1) line 2. -Use of uninitialized value in scalar chop at - line 7. +Use of uninitialized value in scalar chop at - line 9. ######## # Check scope of pragma with eval -use warnings 'uninitialized' ; -eval ' - no warnings ; +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + no warnings ; + my $b ; chop $b ; + '; print STDERR $@ ; my $b ; chop $b ; -'; print STDERR $@ ; -my $b ; chop $b ; +} EXPECT -Use of uninitialized value in scalar chop at - line 8. +Use of uninitialized value in scalar chop at - line 10. ######## # Check scope of pragma with eval -no warnings ; -eval ' +use warnings; +{ + no warnings ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@ ; 1 if $a EQ $b ; -'; print STDERR $@ ; -1 if $a EQ $b ; +} EXPECT ######## # Check scope of pragma with eval -no warnings ; -eval q[ - use warnings 'deprecated' ; +use warnings; +{ + no warnings ; + eval q[ + use warnings 'deprecated' ; + 1 if $a EQ $b ; + ]; print STDERR $@; 1 if $a EQ $b ; -]; print STDERR $@; -1 if $a EQ $b ; +} EXPECT Use of EQ is deprecated at (eval 1) line 3. ######## # Check scope of pragma with eval -use warnings 'deprecated' ; -eval ' +no warnings; +{ + use warnings 'deprecated' ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@; 1 if $a EQ $b ; -'; print STDERR $@; -1 if $a EQ $b ; +} EXPECT -Use of EQ is deprecated at - line 7. +Use of EQ is deprecated at - line 9. Use of EQ is deprecated at (eval 1) line 2. ######## # Check scope of pragma with eval -use warnings 'deprecated' ; -eval ' - no warnings ; +no warnings; +{ + use warnings 'deprecated' ; + eval ' + no warnings ; + 1 if $a EQ $b ; + '; print STDERR $@; 1 if $a EQ $b ; -'; print STDERR $@; -1 if $a EQ $b ; +} EXPECT -Use of EQ is deprecated at - line 8. +Use of EQ is deprecated at - line 10. ######## # Check the additive nature of the pragma diff -ruN perl-5.6.0/t/pragma/warn/3both AP615_source/t/pragma/warn/3both --- perl-5.6.0/t/pragma/warn/3both Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/3both Thu Jun 29 08:28:08 2000 @@ -195,3 +195,72 @@ chop $b ; EXPECT Use of uninitialized value in scalar chop at - line 7. +######## + +# Check scope of pragma with eval +BEGIN { $^W = 1 } +{ + no warnings ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT + +######## + +# Check scope of pragma with eval +BEGIN { $^W = 1 } +use warnings; +{ + no warnings ; + eval q[ + use warnings 'uninitialized' ; + my $b ; chop $b ; + ]; print STDERR $@; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 3. +######## + +# Check scope of pragma with eval +BEGIN { $^W = 0 } +{ + use warnings 'uninitialized' ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 2. +Use of uninitialized value in scalar chop at - line 9. +######## + +# Check scope of pragma with eval +BEGIN { $^W = 0 } +{ + use warnings 'uninitialized' ; + eval ' + no warnings ; + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at - line 10. +######## + +# Check scope of pragma with eval +BEGIN { $^W = 1 } +{ + no warnings ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@ ; + 1 if $a EQ $b ; +} +EXPECT + diff -ruN perl-5.6.0/t/pragma/warn/4lint AP615_source/t/pragma/warn/4lint --- perl-5.6.0/t/pragma/warn/4lint Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/4lint Thu Jun 29 08:28:08 2000 @@ -110,3 +110,107 @@ EXPECT Use of EQ is deprecated at ./abc line 3. Use of uninitialized value in scalar chop at - line 3. +######## +-W +# Check scope of pragma with eval +{ + no warnings ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 2. +Use of uninitialized value in scalar chop at - line 8. +######## +-W +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval q[ + use warnings 'uninitialized' ; + my $b ; chop $b ; + ]; print STDERR $@; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 3. +Use of uninitialized value in scalar chop at - line 10. +######## +-W +# Check scope of pragma with eval +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 2. +Use of uninitialized value in scalar chop at - line 9. +######## +-W +# Check scope of pragma with eval +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + no warnings ; + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT +Use of uninitialized value in scalar chop at (eval 1) line 3. +Use of uninitialized value in scalar chop at - line 10. +######## +-W +# Check scope of pragma with eval +use warnings; +{ + my $a = "1"; my $b = "2"; + no warnings ; + eval q[ + use warnings 'deprecated' ; + 1 if $a EQ $b ; + ]; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT +Use of EQ is deprecated at - line 11. +Use of EQ is deprecated at (eval 1) line 3. +######## +-W +# Check scope of pragma with eval +no warnings; +{ + my $a = "1"; my $b = "2"; + use warnings 'deprecated' ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT +Use of EQ is deprecated at - line 10. +Use of EQ is deprecated at (eval 1) line 2. +######## +-W +# Check scope of pragma with eval +no warnings; +{ + my $a = "1"; my $b = "2"; + use warnings 'deprecated' ; + eval ' + no warnings ; + 1 if $a EQ $b ; + '; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT +Use of EQ is deprecated at - line 11. +Use of EQ is deprecated at (eval 1) line 3. diff -ruN perl-5.6.0/t/pragma/warn/5nolint AP615_source/t/pragma/warn/5nolint --- perl-5.6.0/t/pragma/warn/5nolint Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/5nolint Thu Jun 29 08:28:08 2000 @@ -94,3 +94,111 @@ require "./abc"; my $a ; chop $a ; EXPECT +######## +-X +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval q[ + use warnings 'uninitialized' ; + my $b ; chop $b ; + ]; print STDERR $@; + my $b ; chop $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +no warnings; +{ + use warnings 'uninitialized' ; + eval ' + no warnings ; + my $b ; chop $b ; + '; print STDERR $@ ; + my $b ; chop $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@ ; + 1 if $a EQ $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval q[ + use warnings 'deprecated' ; + 1 if $a EQ $b ; + ]; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +no warnings; +{ + use warnings 'deprecated' ; + eval ' + 1 if $a EQ $b ; + '; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT + +######## +-X +# Check scope of pragma with eval +no warnings; +{ + use warnings 'deprecated' ; + eval ' + no warnings ; + 1 if $a EQ $b ; + '; print STDERR $@; + 1 if $a EQ $b ; +} +EXPECT + diff -ruN perl-5.6.0/t/pragma/warn/6default AP615_source/t/pragma/warn/6default --- perl-5.6.0/t/pragma/warn/6default Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/6default Thu Jun 29 08:28:08 2000 @@ -51,3 +51,71 @@ Integer overflow in binary number at - line 3. Illegal binary digit '2' ignored at - line 3. Binary number > 0b11111111111111111111111111111111 non-portable at - line 3. +######## + +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval ' + my $a = oct "0xfffffffffffffffffg" ; + '; print STDERR $@ ; + my $a = oct "0xfffffffffffffffffg" ; +} +EXPECT + +######## + +# Check scope of pragma with eval +use warnings; +{ + no warnings ; + eval q[ + use warnings ; + my $a = oct "0xfffffffffffffffffg" ; + ]; print STDERR $@; + my $a = oct "0xfffffffffffffffffg" ; +} +EXPECT +Integer overflow in hexadecimal number at (eval 1) line 3. +Illegal hexadecimal digit 'g' ignored at (eval 1) line 3. +Hexadecimal number > 0xffffffff non-portable at (eval 1) line 3. +######## + +# Check scope of pragma with eval +no warnings; +{ + use warnings ; + eval ' + my $a = oct "0xfffffffffffffffffg" ; + '; print STDERR $@ ; +} +EXPECT +Integer overflow in hexadecimal number at (eval 1) line 2. +Illegal hexadecimal digit 'g' ignored at (eval 1) line 2. +Hexadecimal number > 0xffffffff non-portable at (eval 1) line 2. +######## + +# Check scope of pragma with eval +no warnings; +{ + use warnings; + eval ' + no warnings ; + my $a = oct "0xfffffffffffffffffg" ; + '; print STDERR $@ ; +} +EXPECT + +######## + +# Check scope of pragma with eval +no warnings; +{ + use warnings 'deprecated' ; + eval ' + my $a = oct "0xfffffffffffffffffg" ; + '; print STDERR $@; +} +EXPECT + diff -ruN perl-5.6.0/t/pragma/warn/7fatal AP615_source/t/pragma/warn/7fatal --- perl-5.6.0/t/pragma/warn/7fatal Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/7fatal Thu Jun 29 08:29:54 2000 @@ -14,6 +14,18 @@ Use of EQ is deprecated at - line 8. ######## +# Check compile time warning +use warnings FATAL => 'all' ; +{ + no warnings ; + 1 if $a EQ $b ; +} +1 if $a EQ $b ; +print STDERR "The End.\n" ; +EXPECT +Use of EQ is deprecated at - line 8. +######## + # Check runtime scope of pragma use warnings FATAL => 'uninitialized' ; { @@ -27,9 +39,33 @@ ######## # Check runtime scope of pragma +use warnings FATAL => 'all' ; +{ + no warnings ; + my $b ; chop $b ; +} +my $b ; chop $b ; +print STDERR "The End.\n" ; +EXPECT +Use of uninitialized value in scalar chop at - line 8. +######## + +# Check runtime scope of pragma no warnings ; { use warnings FATAL => 'uninitialized' ; + $a = sub { my $b ; chop $b ; } +} +&$a ; +print STDERR "The End.\n" ; +EXPECT +Use of uninitialized value in scalar chop at - line 6. +######## + +# Check runtime scope of pragma +no warnings ; +{ + use warnings FATAL => 'all' ; $a = sub { my $b ; chop $b ; } } &$a ; diff -ruN perl-5.6.0/t/pragma/warn/9enabled AP615_source/t/pragma/warn/9enabled --- perl-5.6.0/t/pragma/warn/9enabled Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/9enabled Thu Jun 29 08:33:28 2000 @@ -332,7 +332,7 @@ EXPECT Usage: warnings::warn([category,] 'message') at - line 4 unknown warnings category 'fred' at - line 6 - require 0 called at - line 6 + eval {...} called at - line 6 ######## --FILE-- abc.pm @@ -817,3 +817,87 @@ def self enabled def abc not enabled def all not enabled +######## +-w +--FILE-- abc.pm +package abc ; +no warnings ; +use warnings::register ; +sub check { + print "ok1\n" if warnings::enabled() ; + print "ok2\n" if warnings::enabled("io") ; + print "ok3\n" if warnings::enabled("all") ; +} +1; +--FILE-- +use abc ; +abc::check() ; +EXPECT +ok1 +ok2 +ok3 +######## +-w +--FILE-- abc.pm +package abc ; +no warnings ; +use warnings::register ; +sub check { + print "ok1\n" if !warnings::enabled() ; + print "ok2\n" if !warnings::enabled("io") ; + print "ok3\n" if !warnings::enabled("all") ; +} +1; +--FILE-- +use abc ; +use warnings 'abc'; +no warnings ; +abc::check() ; +EXPECT +ok1 +ok2 +ok3 +######## + +--FILE-- abc.pm +package abc ; +no warnings ; +use warnings::register ; +sub check { + print "ok1\n" if !warnings::enabled() ; + print "ok2\n" if !warnings::enabled("io") ; + print "ok3\n" if !warnings::enabled("all") ; +} +1; +--FILE-- +use abc ; +use warnings 'abc'; +no warnings ; +BEGIN { $^W = 1 ; } +abc::check() ; +EXPECT +ok1 +ok2 +ok3 +######## + +--FILE-- abc.pm +package abc ; +no warnings ; +use warnings::register ; +sub check { + print "ok1\n" if !warnings::enabled() ; + print "ok2\n" if !warnings::enabled("io") ; + print "ok3\n" if !warnings::enabled("all") ; +} +1; +--FILE-- +use abc ; +use warnings 'abc'; +no warnings ; +$^W = 1 ; +abc::check() ; +EXPECT +ok1 +ok2 +ok3 diff -ruN perl-5.6.0/t/pragma/warn/op AP615_source/t/pragma/warn/op --- perl-5.6.0/t/pragma/warn/op Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/op Thu Jun 29 08:28:56 2000 @@ -150,6 +150,17 @@ # op.c use warnings 'closure' ; sub x { + our $x; + sub y { + $x + } + } +EXPECT + +######## +# op.c +use warnings 'closure' ; +sub x { my $x; sub y { sub { $x } @@ -592,7 +603,6 @@ EXPECT Applying pattern match (m//) to @array will act on scalar(@array) at - line 5. Applying substitution (s///) to @array will act on scalar(@array) at - line 6. -Can't modify private array in substitution (s///) at - line 6, near "s/a/b/ ;" Applying transliteration (tr///) to @array will act on scalar(@array) at - line 7. Applying pattern match (m//) to @array will act on scalar(@array) at - line 8. Applying substitution (s///) to @array will act on scalar(@array) at - line 9. @@ -603,6 +613,7 @@ Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14. Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15. Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16. +Can't modify private array in substitution (s///) at - line 6, near "s/a/b/ ;" BEGIN not safe after errors--compilation aborted at - line 18. ######## # op.c diff -ruN perl-5.6.0/t/pragma/warn/pp_ctl AP615_source/t/pragma/warn/pp_ctl --- perl-5.6.0/t/pragma/warn/pp_ctl Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/pp_ctl Thu Jun 29 08:28:06 2000 @@ -214,4 +214,17 @@ { bless ['A'], 'Foo' for 1..10 } { bless ['B'], 'Foo' for 1..10 } EXPECT - +######## +# pp_ctl.c +use warnings; +eval 'print $foo'; +EXPECT +Use of uninitialized value in print at (eval 1) line 1. +######## +# pp_ctl.c +use warnings; +{ + no warnings; + eval 'print $foo'; +} +EXPECT diff -ruN perl-5.6.0/t/pragma/warn/toke AP615_source/t/pragma/warn/toke --- perl-5.6.0/t/pragma/warn/toke Wed Jul 5 14:34:43 2000 +++ AP615_source/t/pragma/warn/toke Thu Jun 29 08:30:00 2000 @@ -220,12 +220,12 @@ Reversed %= operator at - line 10. Reversed &= operator at - line 11. Reversed .= operator at - line 12. -syntax error at - line 12, near "=." Reversed ^= operator at - line 13. -syntax error at - line 13, near "=^" Reversed |= operator at - line 14. -syntax error at - line 14, near "=|" Reversed <= operator at - line 15. +syntax error at - line 12, near "=." +syntax error at - line 13, near "=^" +syntax error at - line 14, near "=|" Unterminated <> operator at - line 15. ######## # toke.c @@ -434,13 +434,14 @@ # toke.c use warnings ; eval <<'EOE'; +# line 30 "foo" +warn "yelp"; { -#line 30 "foo" $_ = " \x{123} " ; } EOE EXPECT - +yelp at foo line 30. ######## # toke.c my $a = rand + 4 ; diff -ruN perl-5.6.0/toke.c AP615_source/toke.c --- perl-5.6.0/toke.c Wed Jul 5 14:34:44 2000 +++ AP615_source/toke.c Thu Jun 29 08:37:05 2000 @@ -495,8 +495,14 @@ ch = *t; *t = '\0'; - if (t - s > 0) + if (t - s > 0) { +#ifdef USE_ITHREADS + Safefree(CopFILE(PL_curcop)); +#else + SvREFCNT_dec(CopFILEGV(PL_curcop)); +#endif CopFILE_set(PL_curcop, s); + } *t = ch; CopLINE_set(PL_curcop, atoi(n)-1); } @@ -819,7 +825,7 @@ NV nshift = 1.0; STRLEN len; char *start = SvPVx(sv,len); - bool utf = SvUTF8(sv); + bool utf = SvUTF8(sv) ? TRUE : FALSE; char *end = start + len; while (start < end) { I32 skip; @@ -896,7 +902,7 @@ goto finish; s = SvPV_force(sv, len); - if (SvIVX(sv) == -1) + if (SvTYPE(sv) >= SVt_PVIV && SvIVX(sv) == -1) goto finish; send = s + len; while (s < send && *s != '\\') @@ -1389,6 +1395,7 @@ /* \132 indicates an octal constant */ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': + len = 0; /* disallow underscores */ uv = (UV)scan_oct(s, 3, &len); s += len; goto NUM_ESCAPE_INSERT; @@ -1402,10 +1409,12 @@ yyerror("Missing right brace on \\x{}"); e = s; } + len = 1; /* allow underscores */ uv = (UV)scan_hex(s + 1, e - s - 1, &len); s = e + 1; } else { + len = 0; /* disallow underscores */ uv = (UV)scan_hex(s, 2, &len); s += len; } @@ -2655,6 +2664,11 @@ case '#': case '\n': if (PL_lex_state != LEX_NORMAL || (PL_in_eval && !PL_rsfp)) { + if (*s == '#' && s == PL_linestart && PL_in_eval && !PL_rsfp) { + /* handle eval qq[#line 1 "foo"\n ...] */ + CopLINE_dec(PL_curcop); + incline(s); + } d = PL_bufend; while (s < d && *s != '\n') s++; @@ -2917,8 +2931,7 @@ PL_expect = XTERM; TOKEN('('); case ';': - if (CopLINE(PL_curcop) < PL_copline) - PL_copline = CopLINE(PL_curcop); + CLINE; tmp = *s++; OPERATOR(tmp); case ')': @@ -4495,7 +4508,7 @@ for (; !isSPACE(*d) && len; --len, ++d) ; } words = append_elem(OP_LIST, words, - newSVOP(OP_CONST, 0, newSVpvn(b, d-b))); + newSVOP(OP_CONST, 0, tokeq(newSVpvn(b, d-b)))); } } if (words) { diff -ruN perl-5.6.0/universal.c AP615_source/universal.c --- perl-5.6.0/universal.c Wed Jul 5 14:34:44 2000 +++ AP615_source/universal.c Thu Jun 29 08:27:15 2000 @@ -14,29 +14,44 @@ GV* gv; GV** gvp; HV* hv = Nullhv; + SV* subgen = Nullsv; if (!stash) return &PL_sv_undef; - if(strEQ(HvNAME(stash), name)) + if (strEQ(HvNAME(stash), name)) return &PL_sv_yes; if (level > 100) - Perl_croak(aTHX_ "Recursive inheritance detected in package '%s'", HvNAME(stash)); + Perl_croak(aTHX_ "Recursive inheritance detected in package '%s'", + HvNAME(stash)); gvp = (GV**)hv_fetch(stash, "::ISA::CACHE::", 14, FALSE); - if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (hv = GvHV(gv))) { - SV* sv; - SV** svp = (SV**)hv_fetch(hv, name, len, FALSE); - if (svp && (sv = *svp) != (SV*)&PL_sv_undef) - return sv; + if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (subgen = GvSV(gv)) + && (hv = GvHV(gv))) + { + if (SvIV(subgen) == PL_sub_generation) { + SV* sv; + SV** svp = (SV**)hv_fetch(hv, name, len, FALSE); + if (svp && (sv = *svp) != (SV*)&PL_sv_undef) { + DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n", + name, HvNAME(stash)) ); + return sv; + } + } + else { + DEBUG_o( Perl_deb(aTHX_ "ISA Cache in package %s is stale\n", + HvNAME(stash)) ); + hv_clear(hv); + sv_setiv(subgen, PL_sub_generation); + } } gvp = (GV**)hv_fetch(stash,"ISA",3,FALSE); - + if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (av = GvAV(gv))) { - if(!hv) { + if (!hv || !subgen) { gvp = (GV**)hv_fetch(stash, "::ISA::CACHE::", 14, TRUE); gv = *gvp; @@ -44,9 +59,14 @@ if (SvTYPE(gv) != SVt_PVGV) gv_init(gv, stash, "::ISA::CACHE::", 14, TRUE); - hv = GvHVn(gv); + if (!hv) + hv = GvHVn(gv); + if (!subgen) { + subgen = newSViv(PL_sub_generation); + GvSV(gv) = subgen; + } } - if(hv) { + if (hv) { SV** svp = AvARRAY(av); /* NOTE: No support for tied ISA */ I32 items = AvFILLp(av) + 1; @@ -61,7 +81,7 @@ SvPVX(sv), HvNAME(stash)); continue; } - if(&PL_sv_yes == isa_lookup(basestash, name, len, level + 1)) { + if (&PL_sv_yes == isa_lookup(basestash, name, len, level + 1)) { (void)hv_store(hv,name,len,&PL_sv_yes,0); return &PL_sv_yes; } @@ -88,23 +108,23 @@ { char *type; HV *stash; - + stash = Nullhv; type = Nullch; - + if (SvGMAGICAL(sv)) mg_get(sv) ; if (SvROK(sv)) { sv = SvRV(sv); type = sv_reftype(sv,0); - if(SvOBJECT(sv)) + if (SvOBJECT(sv)) stash = SvSTASH(sv); } else { stash = gv_stashsv(sv, FALSE); } - + return (type && strEQ(type,name)) || (stash && isa_lookup(stash, name, strlen(name), 0) == &PL_sv_yes) ? TRUE @@ -174,9 +194,9 @@ name = (char *)SvPV(ST(1),n_a); rv = &PL_sv_undef; - if(SvROK(sv)) { + if (SvROK(sv)) { sv = (SV*)SvRV(sv); - if(SvOBJECT(sv)) + if (SvOBJECT(sv)) pkg = SvSTASH(sv); } else { @@ -242,7 +262,7 @@ break; } if (len) { - if (SvNIOKp(req) && SvPOK(req)) { + if (SvNOK(req) && SvPOK(req)) { /* they said C and $Foo::VERSION * doesn't look like a float: do string compare */ if (sv_cmp(req,sv) == 1) { @@ -263,7 +283,7 @@ /* if we get here, we're looking for a numeric comparison, * so force the required version into a float, even if they * said C */ - if (SvNIOKp(req) && SvPOK(req)) { + if (SvNOK(req) && SvPOK(req)) { NV n = SvNV(req); req = sv_newmortal(); sv_setnv(req, n); diff -ruN perl-5.6.0/util.c AP615_source/util.c --- perl-5.6.0/util.c Wed Jul 5 14:34:44 2000 +++ AP615_source/util.c Thu Jun 29 08:33:07 2000 @@ -1580,14 +1580,20 @@ SV *msv; STRLEN msglen; - msv = vmess(pat, args); - if (PL_errors && SvCUR(PL_errors)) { - sv_catsv(PL_errors, msv); - message = SvPV(PL_errors, msglen); - SvCUR_set(PL_errors, 0); + if (pat) { + msv = vmess(pat, args); + if (PL_errors && SvCUR(PL_errors)) { + sv_catsv(PL_errors, msv); + message = SvPV(PL_errors, msglen); + SvCUR_set(PL_errors, 0); + } + else + message = SvPV(msv,msglen); + } + else { + message = Nullch; + msglen = 0; } - else - message = SvPV(msv,msglen); DEBUG_S(PerlIO_printf(Perl_debug_log, "croak: 0x%"UVxf" %s", PTR2UV(thr), message)); @@ -1606,9 +1612,14 @@ ENTER; save_re_context(); - msg = newSVpvn(message, msglen); - SvREADONLY_on(msg); - SAVEFREESV(msg); + if (message) { + msg = newSVpvn(message, msglen); + SvREADONLY_on(msg); + SAVEFREESV(msg); + } + else { + msg = ERRSV; + } PUSHSTACKi(PERLSI_DIEHOOK); PUSHMARK(SP); @@ -1655,9 +1666,16 @@ /* =for apidoc croak -This is the XSUB-writer's interface to Perl's C function. Use this -function the same way you use the C C function. See -C. +This is the XSUB-writer's interface to Perl's C function. +Normally use this function the same way you use the C C +function. See C. + +If you want to throw an exception object, assign the object to +C<$@> and then pass C to croak(): + + errsv = get_sv("@", TRUE); + sv_setsv(errsv, exception_object); + croak(Nullch); =cut */ @@ -2877,9 +2895,13 @@ for (; len-- && *s; s++) { if (!(*s == '0' || *s == '1')) { - if (*s == '_') - continue; /* Note: does not check for __ and the like. */ - if (seenb == FALSE && *s == 'b' && ruv == 0) { + if (*s == '_' && len && *retlen + && (s[1] == '0' || s[1] == '1')) + { + --len; + ++s; + } + else if (seenb == FALSE && *s == 'b' && ruv == 0) { /* Disallow 0bbb0b0bbb... */ seenb = TRUE; continue; @@ -2902,7 +2924,8 @@ if (ckWARN_d(WARN_OVERFLOW)) Perl_warner(aTHX_ WARN_OVERFLOW, "Integer overflow in binary number"); - } else + } + else ruv = xuv | (*s - '0'); } if (overflowed) { @@ -2942,8 +2965,12 @@ for (; len-- && *s; s++) { if (!(*s >= '0' && *s <= '7')) { - if (*s == '_') - continue; /* Note: does not check for __ and the like. */ + if (*s == '_' && len && *retlen + && (s[1] >= '0' && s[1] <= '7')) + { + --len; + ++s; + } else { /* Allow \octal to work the DWIM way (that is, stop scanning * as soon as non-octal characters are seen, complain only iff @@ -2967,7 +2994,8 @@ if (ckWARN_d(WARN_OVERFLOW)) Perl_warner(aTHX_ WARN_OVERFLOW, "Integer overflow in octal number"); - } else + } + else ruv = xuv | (*s - '0'); } if (overflowed) { @@ -3010,9 +3038,13 @@ for (; len-- && *s; s++) { hexdigit = strchr((char *) PL_hexdigit, *s); if (!hexdigit) { - if (*s == '_') - continue; /* Note: does not check for __ and the like. */ - if (seenx == FALSE && *s == 'x' && ruv == 0) { + if (*s == '_' && len && *retlen && s[1] + && (hexdigit = strchr((char *) PL_hexdigit, s[1]))) + { + --len; + ++s; + } + else if (seenx == FALSE && *s == 'x' && ruv == 0) { /* Disallow 0xxx0x0xxx... */ seenx = TRUE; continue; @@ -3035,7 +3067,8 @@ if (ckWARN_d(WARN_OVERFLOW)) Perl_warner(aTHX_ WARN_OVERFLOW, "Integer overflow in hexadecimal number"); - } else + } + else ruv = xuv | ((hexdigit - PL_hexdigit) & 15); } if (overflowed) { diff -ruN perl-5.6.0/utils/perldoc.PL AP615_source/utils/perldoc.PL --- perl-5.6.0/utils/perldoc.PL Wed Jul 5 14:34:44 2000 +++ AP615_source/utils/perldoc.PL Thu Jun 29 08:30:18 2000 @@ -202,7 +202,8 @@ # don't add if superuser if ($< && $>) { # don't be looking too hard now! - eval q{ use blib; 1 } or die; + eval q{ use blib; 1 }; + warn $@ if $@ && $opt_v; } } @@ -790,7 +791,7 @@ =head1 VERSION -This is perldoc v2.01. +This is perldoc v2.03. =head1 AUTHOR @@ -802,6 +803,9 @@ =cut # +# Version 2.03: Sun Apr 23 16:56:34 BST 2000 +# Hugo van der Sanden +# don't die when 'use blib' fails # Version 2.02: Mon Mar 13 18:03:04 MST 2000 # Tom Christiansen # Added -U insecurity option diff -ruN perl-5.6.0/vms/perly_c.vms AP615_source/vms/perly_c.vms --- perl-5.6.0/vms/perly_c.vms Wed Jul 5 14:34:45 2000 +++ AP615_source/vms/perly_c.vms Thu Jun 29 08:37:05 2000 @@ -1387,6 +1387,9 @@ #endif struct ysv *ysave; +#ifdef USE_ITHREADS + ENTER; /* force yydestruct() before we return */ +#endif New(73, ysave, 1, struct ysv); SAVEDESTRUCTOR_X(yydestruct, ysave); ysave->oldyydebug = yydebug; @@ -2479,6 +2482,9 @@ yyabort: retval = 1; yyaccept: +#ifdef USE_ITHREADS + LEAVE; /* force yydestruct() before we return */ +#endif return retval; } diff -ruN perl-5.6.0/warnings.h AP615_source/warnings.h --- perl-5.6.0/warnings.h Wed Jul 5 14:34:47 2000 +++ AP615_source/warnings.h Thu Jun 29 08:29:54 2000 @@ -22,45 +22,6 @@ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE) - -#define ckDEAD(x) \ - ( ! specialWARN(PL_curcop->cop_warnings) && \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x+1)) - -#define ckWARN(x) \ - ( (PL_curcop->cop_warnings != pWARN_STD && \ - PL_curcop->cop_warnings != pWARN_NONE && \ - (PL_curcop->cop_warnings == pWARN_ALL || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) \ - || (PL_curcop->cop_warnings == pWARN_STD && PL_dowarn & G_WARN_ON) ) - -#define ckWARN2(x,y) \ - ( (PL_curcop->cop_warnings != pWARN_STD && \ - PL_curcop->cop_warnings != pWARN_NONE && \ - (PL_curcop->cop_warnings == pWARN_ALL || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) \ - || (PL_curcop->cop_warnings == pWARN_STD && PL_dowarn & G_WARN_ON) ) - -#define ckWARN_d(x) \ - (PL_curcop->cop_warnings == pWARN_STD || \ - PL_curcop->cop_warnings == pWARN_ALL || \ - (PL_curcop->cop_warnings != pWARN_NONE && \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) - -#define ckWARN2_d(x,y) \ - (PL_curcop->cop_warnings == pWARN_STD || \ - PL_curcop->cop_warnings == pWARN_ALL || \ - (PL_curcop->cop_warnings != pWARN_NONE && \ - (IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) ) - - -#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) -#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) -#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) -#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x))) - #define WARN_ALL 0 #define WARN_CHMOD 1 #define WARN_CLOSURE 2 @@ -112,6 +73,41 @@ #define WARNsize 12 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125" #define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0" + +#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) +#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) +#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) +#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x))) +#define isWARNf_on(c,x) (IsSet(SvPVX(c), 2*(x)+1)) + +#define ckDEAD(x) \ + ( ! specialWARN(PL_curcop->cop_warnings) && \ + ( isWARNf_on(PL_curcop->cop_warnings, WARN_ALL) || \ + isWARNf_on(PL_curcop->cop_warnings, x))) + +#define ckWARN(x) \ + ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \ + (PL_curcop->cop_warnings == pWARN_ALL || \ + isWARN_on(PL_curcop->cop_warnings, x) ) ) \ + || (isLEXWARN_off && PL_dowarn & G_WARN_ON) ) + +#define ckWARN2(x,y) \ + ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \ + (PL_curcop->cop_warnings == pWARN_ALL || \ + isWARN_on(PL_curcop->cop_warnings, x) || \ + isWARN_on(PL_curcop->cop_warnings, y) ) ) \ + || (isLEXWARN_off && PL_dowarn & G_WARN_ON) ) + +#define ckWARN_d(x) \ + (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \ + (PL_curcop->cop_warnings != pWARN_NONE && \ + isWARN_on(PL_curcop->cop_warnings, x) ) ) + +#define ckWARN2_d(x,y) \ + (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \ + (PL_curcop->cop_warnings != pWARN_NONE && \ + (isWARN_on(PL_curcop->cop_warnings, x) || \ + isWARN_on(PL_curcop->cop_warnings, y) ) ) ) /* end of file warnings.h */ diff -ruN perl-5.6.0/warnings.pl AP615_source/warnings.pl --- perl-5.6.0/warnings.pl Wed Jul 5 14:34:47 2000 +++ AP615_source/warnings.pl Thu Jun 29 08:29:54 2000 @@ -199,45 +199,6 @@ #define specialWARN(x) ((x) == pWARN_STD || (x) == pWARN_ALL || \ (x) == pWARN_NONE) - -#define ckDEAD(x) \ - ( ! specialWARN(PL_curcop->cop_warnings) && \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x+1)) - -#define ckWARN(x) \ - ( (PL_curcop->cop_warnings != pWARN_STD && \ - PL_curcop->cop_warnings != pWARN_NONE && \ - (PL_curcop->cop_warnings == pWARN_ALL || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) \ - || (PL_curcop->cop_warnings == pWARN_STD && PL_dowarn & G_WARN_ON) ) - -#define ckWARN2(x,y) \ - ( (PL_curcop->cop_warnings != pWARN_STD && \ - PL_curcop->cop_warnings != pWARN_NONE && \ - (PL_curcop->cop_warnings == pWARN_ALL || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) \ - || (PL_curcop->cop_warnings == pWARN_STD && PL_dowarn & G_WARN_ON) ) - -#define ckWARN_d(x) \ - (PL_curcop->cop_warnings == pWARN_STD || \ - PL_curcop->cop_warnings == pWARN_ALL || \ - (PL_curcop->cop_warnings != pWARN_NONE && \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) ) ) - -#define ckWARN2_d(x,y) \ - (PL_curcop->cop_warnings == pWARN_STD || \ - PL_curcop->cop_warnings == pWARN_ALL || \ - (PL_curcop->cop_warnings != pWARN_NONE && \ - (IsSet(SvPVX(PL_curcop->cop_warnings), 2*x) || \ - IsSet(SvPVX(PL_curcop->cop_warnings), 2*y) ) ) ) - - -#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) -#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) -#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) -#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x))) - EOM my $offset = 0 ; @@ -262,6 +223,41 @@ print WARN tab(5, '#define WARN_NONEstring'), '"', ('\0' x $warn_size) , "\"\n" ; print WARN <<'EOM'; + +#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD) +#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD) +#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE)) +#define isWARN_on(c,x) (IsSet(SvPVX(c), 2*(x))) +#define isWARNf_on(c,x) (IsSet(SvPVX(c), 2*(x)+1)) + +#define ckDEAD(x) \ + ( ! specialWARN(PL_curcop->cop_warnings) && \ + ( isWARNf_on(PL_curcop->cop_warnings, WARN_ALL) || \ + isWARNf_on(PL_curcop->cop_warnings, x))) + +#define ckWARN(x) \ + ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \ + (PL_curcop->cop_warnings == pWARN_ALL || \ + isWARN_on(PL_curcop->cop_warnings, x) ) ) \ + || (isLEXWARN_off && PL_dowarn & G_WARN_ON) ) + +#define ckWARN2(x,y) \ + ( (isLEXWARN_on && PL_curcop->cop_warnings != pWARN_NONE && \ + (PL_curcop->cop_warnings == pWARN_ALL || \ + isWARN_on(PL_curcop->cop_warnings, x) || \ + isWARN_on(PL_curcop->cop_warnings, y) ) ) \ + || (isLEXWARN_off && PL_dowarn & G_WARN_ON) ) + +#define ckWARN_d(x) \ + (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \ + (PL_curcop->cop_warnings != pWARN_NONE && \ + isWARN_on(PL_curcop->cop_warnings, x) ) ) + +#define ckWARN2_d(x,y) \ + (isLEXWARN_off || PL_curcop->cop_warnings == pWARN_ALL || \ + (PL_curcop->cop_warnings != pWARN_NONE && \ + (isWARN_on(PL_curcop->cop_warnings, x) || \ + isWARN_on(PL_curcop->cop_warnings, y) ) ) ) /* end of file warnings.h */ diff -ruN perl-5.6.0/win32/Makefile AP615_source/win32/Makefile --- perl-5.6.0/win32/Makefile Wed Jul 5 14:34:47 2000 +++ AP615_source/win32/Makefile Wed Jul 5 12:22:23 2000 @@ -17,8 +17,8 @@ # Set these to wherever you want "nmake install" to put your # newly built perl. # -INST_DRV = c: -INST_TOP = $(INST_DRV)\perl +INST_DRV = p: +INST_TOP = $(INST_DRV)\Apps\Gecko\temp # # Comment this out if you DON'T want your perl installation to be versioned. @@ -29,7 +29,7 @@ # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER = \5.6.0 +#INST_VER = \5.6.0 # # Comment this out if you DON'T want your perl installation to have @@ -40,27 +40,27 @@ # the same location. Commenting it out gives you a simpler # installation that is easier to understand for beginners. # -INST_ARCH = \$(ARCHNAME) +#INST_ARCH = \$(ARCHNAME) # # uncomment to enable multiple interpreters. This is need for fork() # emulation. # -#USE_MULTI = define +USE_MULTI = define # # Beginnings of interpreter cloning/threads; still very incomplete. # This should be enabled to get the fork() emulation. This needs # USE_MULTI as well. # -#USE_ITHREADS = define +USE_ITHREADS = define # # uncomment to enable the implicit "host" layer for all system calls # made by perl. This needs USE_MULTI above. This is also needed to # get fork(). # -#USE_IMP_SYS = define +USE_IMP_SYS = define # # WARNING! This option is deprecated and will eventually go away (enable @@ -88,7 +88,7 @@ # Visual C++ 2.x or Visual C++ 6.x (aka Visual Studio 98) # #CCTYPE = MSVC20 -#CCTYPE = MSVC60 +CCTYPE = MSVC60 # # uncomment next line if you want debug version of perl (big,slow) @@ -120,7 +120,7 @@ # file exists (see README.win32). File should be located in the same # directory as this file. # -#CRYPT_SRC = fcrypt.c +CRYPT_SRC = fcrypt.c # # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a @@ -185,7 +185,7 @@ # set this to your email address (perl will guess a value from # from your loginname and your hostname, which may not be right) # -#EMAIL = +EMAIL = support@activestate.com ## ## Build configuration ends. @@ -339,8 +339,8 @@ LIBC = PerlCRT.lib !ENDIF -PERLEXE_RES = -PERLDLL_RES = +PERLEXE_RES = perlexe.res +PERLDLL_RES = perldll.res !IF "$(CFG)" == "Debug" ! IF "$(CCTYPE)" == "MSVC20" @@ -830,7 +830,7 @@ $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) - $(LINK32) -subsystem:console -out:$@ -stack:0x8000000 $(LINK_FLAGS) \ + $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) copy $(PERLEXE) $(WPERLEXE) $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS @@ -991,10 +991,10 @@ -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm -del /f $(LIBDIR)\File\Glob.pm - -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO - -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread - -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B - -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data + -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO + -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread + -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B + -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data -del /f $(PODDIR)\*.html -del /f $(PODDIR)\*.bat cd ..\utils @@ -1011,8 +1011,8 @@ cd $(EXTDIR) -del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib cd ..\win32 - -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) - -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) + -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) + -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) install : all installbare installhtml @@ -1080,7 +1080,7 @@ -@erase $(WPERLEXE) -@erase $(PERLDLL) -@erase $(CORE_OBJ) - -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) + -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) -@erase $(WIN32_OBJ) -@erase $(DLL_OBJ) -@erase $(X2P_OBJ) diff -ruN perl-5.6.0/win32/fcrypt.c AP615_source/win32/fcrypt.c --- perl-5.6.0/win32/fcrypt.c Wed Dec 31 16:00:00 1969 +++ AP615_source/win32/fcrypt.c Thu May 25 01:14:41 2000 @@ -0,0 +1,578 @@ +/* fcrypt.c */ +/* Copyright (C) 1993 Eric Young - see README for more details */ +#include + +/* Eric Young. + * This version of crypt has been developed from my MIT compatable + * DES library. + * The library is available at pub/DES at ftp.psy.uq.oz.au + * eay@psych.psy.uq.oz.au + */ + +typedef unsigned char des_cblock[8]; + +typedef struct des_ks_struct + { + union { + des_cblock _; + /* make sure things are correct size on machines with + * 8 byte longs */ + unsigned long pad[2]; + } ks; +#define _ ks._ + } des_key_schedule[16]; + +#define DES_KEY_SZ (sizeof(des_cblock)) +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#define ITERATIONS 16 +#define HALF_ITERATIONS 8 + +#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ + l|=((unsigned long)(*((c)++)))<< 8, \ + l|=((unsigned long)(*((c)++)))<<16, \ + l|=((unsigned long)(*((c)++)))<<24) + +#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ + *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ + *((c)++)=(unsigned char)(((l)>>16)&0xff), \ + *((c)++)=(unsigned char)(((l)>>24)&0xff)) + +static unsigned long SPtrans[8][64]={ +/* nibble 0 */ +0x00820200, 0x00020000, 0x80800000, 0x80820200, +0x00800000, 0x80020200, 0x80020000, 0x80800000, +0x80020200, 0x00820200, 0x00820000, 0x80000200, +0x80800200, 0x00800000, 0x00000000, 0x80020000, +0x00020000, 0x80000000, 0x00800200, 0x00020200, +0x80820200, 0x00820000, 0x80000200, 0x00800200, +0x80000000, 0x00000200, 0x00020200, 0x80820000, +0x00000200, 0x80800200, 0x80820000, 0x00000000, +0x00000000, 0x80820200, 0x00800200, 0x80020000, +0x00820200, 0x00020000, 0x80000200, 0x00800200, +0x80820000, 0x00000200, 0x00020200, 0x80800000, +0x80020200, 0x80000000, 0x80800000, 0x00820000, +0x80820200, 0x00020200, 0x00820000, 0x80800200, +0x00800000, 0x80000200, 0x80020000, 0x00000000, +0x00020000, 0x00800000, 0x80800200, 0x00820200, +0x80000000, 0x80820000, 0x00000200, 0x80020200, +/* nibble 1 */ +0x10042004, 0x00000000, 0x00042000, 0x10040000, +0x10000004, 0x00002004, 0x10002000, 0x00042000, +0x00002000, 0x10040004, 0x00000004, 0x10002000, +0x00040004, 0x10042000, 0x10040000, 0x00000004, +0x00040000, 0x10002004, 0x10040004, 0x00002000, +0x00042004, 0x10000000, 0x00000000, 0x00040004, +0x10002004, 0x00042004, 0x10042000, 0x10000004, +0x10000000, 0x00040000, 0x00002004, 0x10042004, +0x00040004, 0x10042000, 0x10002000, 0x00042004, +0x10042004, 0x00040004, 0x10000004, 0x00000000, +0x10000000, 0x00002004, 0x00040000, 0x10040004, +0x00002000, 0x10000000, 0x00042004, 0x10002004, +0x10042000, 0x00002000, 0x00000000, 0x10000004, +0x00000004, 0x10042004, 0x00042000, 0x10040000, +0x10040004, 0x00040000, 0x00002004, 0x10002000, +0x10002004, 0x00000004, 0x10040000, 0x00042000, +/* nibble 2 */ +0x41000000, 0x01010040, 0x00000040, 0x41000040, +0x40010000, 0x01000000, 0x41000040, 0x00010040, +0x01000040, 0x00010000, 0x01010000, 0x40000000, +0x41010040, 0x40000040, 0x40000000, 0x41010000, +0x00000000, 0x40010000, 0x01010040, 0x00000040, +0x40000040, 0x41010040, 0x00010000, 0x41000000, +0x41010000, 0x01000040, 0x40010040, 0x01010000, +0x00010040, 0x00000000, 0x01000000, 0x40010040, +0x01010040, 0x00000040, 0x40000000, 0x00010000, +0x40000040, 0x40010000, 0x01010000, 0x41000040, +0x00000000, 0x01010040, 0x00010040, 0x41010000, +0x40010000, 0x01000000, 0x41010040, 0x40000000, +0x40010040, 0x41000000, 0x01000000, 0x41010040, +0x00010000, 0x01000040, 0x41000040, 0x00010040, +0x01000040, 0x00000000, 0x41010000, 0x40000040, +0x41000000, 0x40010040, 0x00000040, 0x01010000, +/* nibble 3 */ +0x00100402, 0x04000400, 0x00000002, 0x04100402, +0x00000000, 0x04100000, 0x04000402, 0x00100002, +0x04100400, 0x04000002, 0x04000000, 0x00000402, +0x04000002, 0x00100402, 0x00100000, 0x04000000, +0x04100002, 0x00100400, 0x00000400, 0x00000002, +0x00100400, 0x04000402, 0x04100000, 0x00000400, +0x00000402, 0x00000000, 0x00100002, 0x04100400, +0x04000400, 0x04100002, 0x04100402, 0x00100000, +0x04100002, 0x00000402, 0x00100000, 0x04000002, +0x00100400, 0x04000400, 0x00000002, 0x04100000, +0x04000402, 0x00000000, 0x00000400, 0x00100002, +0x00000000, 0x04100002, 0x04100400, 0x00000400, +0x04000000, 0x04100402, 0x00100402, 0x00100000, +0x04100402, 0x00000002, 0x04000400, 0x00100402, +0x00100002, 0x00100400, 0x04100000, 0x04000402, +0x00000402, 0x04000000, 0x04000002, 0x04100400, +/* nibble 4 */ +0x02000000, 0x00004000, 0x00000100, 0x02004108, +0x02004008, 0x02000100, 0x00004108, 0x02004000, +0x00004000, 0x00000008, 0x02000008, 0x00004100, +0x02000108, 0x02004008, 0x02004100, 0x00000000, +0x00004100, 0x02000000, 0x00004008, 0x00000108, +0x02000100, 0x00004108, 0x00000000, 0x02000008, +0x00000008, 0x02000108, 0x02004108, 0x00004008, +0x02004000, 0x00000100, 0x00000108, 0x02004100, +0x02004100, 0x02000108, 0x00004008, 0x02004000, +0x00004000, 0x00000008, 0x02000008, 0x02000100, +0x02000000, 0x00004100, 0x02004108, 0x00000000, +0x00004108, 0x02000000, 0x00000100, 0x00004008, +0x02000108, 0x00000100, 0x00000000, 0x02004108, +0x02004008, 0x02004100, 0x00000108, 0x00004000, +0x00004100, 0x02004008, 0x02000100, 0x00000108, +0x00000008, 0x00004108, 0x02004000, 0x02000008, +/* nibble 5 */ +0x20000010, 0x00080010, 0x00000000, 0x20080800, +0x00080010, 0x00000800, 0x20000810, 0x00080000, +0x00000810, 0x20080810, 0x00080800, 0x20000000, +0x20000800, 0x20000010, 0x20080000, 0x00080810, +0x00080000, 0x20000810, 0x20080010, 0x00000000, +0x00000800, 0x00000010, 0x20080800, 0x20080010, +0x20080810, 0x20080000, 0x20000000, 0x00000810, +0x00000010, 0x00080800, 0x00080810, 0x20000800, +0x00000810, 0x20000000, 0x20000800, 0x00080810, +0x20080800, 0x00080010, 0x00000000, 0x20000800, +0x20000000, 0x00000800, 0x20080010, 0x00080000, +0x00080010, 0x20080810, 0x00080800, 0x00000010, +0x20080810, 0x00080800, 0x00080000, 0x20000810, +0x20000010, 0x20080000, 0x00080810, 0x00000000, +0x00000800, 0x20000010, 0x20000810, 0x20080800, +0x20080000, 0x00000810, 0x00000010, 0x20080010, +/* nibble 6 */ +0x00001000, 0x00000080, 0x00400080, 0x00400001, +0x00401081, 0x00001001, 0x00001080, 0x00000000, +0x00400000, 0x00400081, 0x00000081, 0x00401000, +0x00000001, 0x00401080, 0x00401000, 0x00000081, +0x00400081, 0x00001000, 0x00001001, 0x00401081, +0x00000000, 0x00400080, 0x00400001, 0x00001080, +0x00401001, 0x00001081, 0x00401080, 0x00000001, +0x00001081, 0x00401001, 0x00000080, 0x00400000, +0x00001081, 0x00401000, 0x00401001, 0x00000081, +0x00001000, 0x00000080, 0x00400000, 0x00401001, +0x00400081, 0x00001081, 0x00001080, 0x00000000, +0x00000080, 0x00400001, 0x00000001, 0x00400080, +0x00000000, 0x00400081, 0x00400080, 0x00001080, +0x00000081, 0x00001000, 0x00401081, 0x00400000, +0x00401080, 0x00000001, 0x00001001, 0x00401081, +0x00400001, 0x00401080, 0x00401000, 0x00001001, +/* nibble 7 */ +0x08200020, 0x08208000, 0x00008020, 0x00000000, +0x08008000, 0x00200020, 0x08200000, 0x08208020, +0x00000020, 0x08000000, 0x00208000, 0x00008020, +0x00208020, 0x08008020, 0x08000020, 0x08200000, +0x00008000, 0x00208020, 0x00200020, 0x08008000, +0x08208020, 0x08000020, 0x00000000, 0x00208000, +0x08000000, 0x00200000, 0x08008020, 0x08200020, +0x00200000, 0x00008000, 0x08208000, 0x00000020, +0x00200000, 0x00008000, 0x08000020, 0x08208020, +0x00008020, 0x08000000, 0x00000000, 0x00208000, +0x08200020, 0x08008020, 0x08008000, 0x00200020, +0x08208000, 0x00000020, 0x00200020, 0x08008000, +0x08208020, 0x00200000, 0x08200000, 0x08000020, +0x00208000, 0x00008020, 0x08008020, 0x08200000, +0x00000020, 0x08208000, 0x00208020, 0x00000000, +0x08000000, 0x08200020, 0x00008000, 0x00208020}; +static unsigned long skb[8][64]={ +/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ +0x00000000,0x00000010,0x20000000,0x20000010, +0x00010000,0x00010010,0x20010000,0x20010010, +0x00000800,0x00000810,0x20000800,0x20000810, +0x00010800,0x00010810,0x20010800,0x20010810, +0x00000020,0x00000030,0x20000020,0x20000030, +0x00010020,0x00010030,0x20010020,0x20010030, +0x00000820,0x00000830,0x20000820,0x20000830, +0x00010820,0x00010830,0x20010820,0x20010830, +0x00080000,0x00080010,0x20080000,0x20080010, +0x00090000,0x00090010,0x20090000,0x20090010, +0x00080800,0x00080810,0x20080800,0x20080810, +0x00090800,0x00090810,0x20090800,0x20090810, +0x00080020,0x00080030,0x20080020,0x20080030, +0x00090020,0x00090030,0x20090020,0x20090030, +0x00080820,0x00080830,0x20080820,0x20080830, +0x00090820,0x00090830,0x20090820,0x20090830, +/* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ +0x00000000,0x02000000,0x00002000,0x02002000, +0x00200000,0x02200000,0x00202000,0x02202000, +0x00000004,0x02000004,0x00002004,0x02002004, +0x00200004,0x02200004,0x00202004,0x02202004, +0x00000400,0x02000400,0x00002400,0x02002400, +0x00200400,0x02200400,0x00202400,0x02202400, +0x00000404,0x02000404,0x00002404,0x02002404, +0x00200404,0x02200404,0x00202404,0x02202404, +0x10000000,0x12000000,0x10002000,0x12002000, +0x10200000,0x12200000,0x10202000,0x12202000, +0x10000004,0x12000004,0x10002004,0x12002004, +0x10200004,0x12200004,0x10202004,0x12202004, +0x10000400,0x12000400,0x10002400,0x12002400, +0x10200400,0x12200400,0x10202400,0x12202400, +0x10000404,0x12000404,0x10002404,0x12002404, +0x10200404,0x12200404,0x10202404,0x12202404, +/* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ +0x00000000,0x00000001,0x00040000,0x00040001, +0x01000000,0x01000001,0x01040000,0x01040001, +0x00000002,0x00000003,0x00040002,0x00040003, +0x01000002,0x01000003,0x01040002,0x01040003, +0x00000200,0x00000201,0x00040200,0x00040201, +0x01000200,0x01000201,0x01040200,0x01040201, +0x00000202,0x00000203,0x00040202,0x00040203, +0x01000202,0x01000203,0x01040202,0x01040203, +0x08000000,0x08000001,0x08040000,0x08040001, +0x09000000,0x09000001,0x09040000,0x09040001, +0x08000002,0x08000003,0x08040002,0x08040003, +0x09000002,0x09000003,0x09040002,0x09040003, +0x08000200,0x08000201,0x08040200,0x08040201, +0x09000200,0x09000201,0x09040200,0x09040201, +0x08000202,0x08000203,0x08040202,0x08040203, +0x09000202,0x09000203,0x09040202,0x09040203, +/* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ +0x00000000,0x00100000,0x00000100,0x00100100, +0x00000008,0x00100008,0x00000108,0x00100108, +0x00001000,0x00101000,0x00001100,0x00101100, +0x00001008,0x00101008,0x00001108,0x00101108, +0x04000000,0x04100000,0x04000100,0x04100100, +0x04000008,0x04100008,0x04000108,0x04100108, +0x04001000,0x04101000,0x04001100,0x04101100, +0x04001008,0x04101008,0x04001108,0x04101108, +0x00020000,0x00120000,0x00020100,0x00120100, +0x00020008,0x00120008,0x00020108,0x00120108, +0x00021000,0x00121000,0x00021100,0x00121100, +0x00021008,0x00121008,0x00021108,0x00121108, +0x04020000,0x04120000,0x04020100,0x04120100, +0x04020008,0x04120008,0x04020108,0x04120108, +0x04021000,0x04121000,0x04021100,0x04121100, +0x04021008,0x04121008,0x04021108,0x04121108, +/* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ +0x00000000,0x10000000,0x00010000,0x10010000, +0x00000004,0x10000004,0x00010004,0x10010004, +0x20000000,0x30000000,0x20010000,0x30010000, +0x20000004,0x30000004,0x20010004,0x30010004, +0x00100000,0x10100000,0x00110000,0x10110000, +0x00100004,0x10100004,0x00110004,0x10110004, +0x20100000,0x30100000,0x20110000,0x30110000, +0x20100004,0x30100004,0x20110004,0x30110004, +0x00001000,0x10001000,0x00011000,0x10011000, +0x00001004,0x10001004,0x00011004,0x10011004, +0x20001000,0x30001000,0x20011000,0x30011000, +0x20001004,0x30001004,0x20011004,0x30011004, +0x00101000,0x10101000,0x00111000,0x10111000, +0x00101004,0x10101004,0x00111004,0x10111004, +0x20101000,0x30101000,0x20111000,0x30111000, +0x20101004,0x30101004,0x20111004,0x30111004, +/* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ +0x00000000,0x08000000,0x00000008,0x08000008, +0x00000400,0x08000400,0x00000408,0x08000408, +0x00020000,0x08020000,0x00020008,0x08020008, +0x00020400,0x08020400,0x00020408,0x08020408, +0x00000001,0x08000001,0x00000009,0x08000009, +0x00000401,0x08000401,0x00000409,0x08000409, +0x00020001,0x08020001,0x00020009,0x08020009, +0x00020401,0x08020401,0x00020409,0x08020409, +0x02000000,0x0A000000,0x02000008,0x0A000008, +0x02000400,0x0A000400,0x02000408,0x0A000408, +0x02020000,0x0A020000,0x02020008,0x0A020008, +0x02020400,0x0A020400,0x02020408,0x0A020408, +0x02000001,0x0A000001,0x02000009,0x0A000009, +0x02000401,0x0A000401,0x02000409,0x0A000409, +0x02020001,0x0A020001,0x02020009,0x0A020009, +0x02020401,0x0A020401,0x02020409,0x0A020409, +/* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ +0x00000000,0x00000100,0x00080000,0x00080100, +0x01000000,0x01000100,0x01080000,0x01080100, +0x00000010,0x00000110,0x00080010,0x00080110, +0x01000010,0x01000110,0x01080010,0x01080110, +0x00200000,0x00200100,0x00280000,0x00280100, +0x01200000,0x01200100,0x01280000,0x01280100, +0x00200010,0x00200110,0x00280010,0x00280110, +0x01200010,0x01200110,0x01280010,0x01280110, +0x00000200,0x00000300,0x00080200,0x00080300, +0x01000200,0x01000300,0x01080200,0x01080300, +0x00000210,0x00000310,0x00080210,0x00080310, +0x01000210,0x01000310,0x01080210,0x01080310, +0x00200200,0x00200300,0x00280200,0x00280300, +0x01200200,0x01200300,0x01280200,0x01280300, +0x00200210,0x00200310,0x00280210,0x00280310, +0x01200210,0x01200310,0x01280210,0x01280310, +/* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ +0x00000000,0x04000000,0x00040000,0x04040000, +0x00000002,0x04000002,0x00040002,0x04040002, +0x00002000,0x04002000,0x00042000,0x04042000, +0x00002002,0x04002002,0x00042002,0x04042002, +0x00000020,0x04000020,0x00040020,0x04040020, +0x00000022,0x04000022,0x00040022,0x04040022, +0x00002020,0x04002020,0x00042020,0x04042020, +0x00002022,0x04002022,0x00042022,0x04042022, +0x00000800,0x04000800,0x00040800,0x04040800, +0x00000802,0x04000802,0x00040802,0x04040802, +0x00002800,0x04002800,0x00042800,0x04042800, +0x00002802,0x04002802,0x00042802,0x04042802, +0x00000820,0x04000820,0x00040820,0x04040820, +0x00000822,0x04000822,0x00040822,0x04040822, +0x00002820,0x04002820,0x00042820,0x04042820, +0x00002822,0x04002822,0x00042822,0x04042822, +}; + +/* See ecb_encrypt.c for a pseudo description of these macros. */ +#define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\ + (b)^=(t),\ + (a)^=((t)<<(n))) + +#define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\ + (a)=(a)^(t)^(t>>(16-(n))))\ + +static char shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; + +static int body( + unsigned long *out0, + unsigned long *out1, + des_key_schedule ks, + unsigned long Eswap0, + unsigned long Eswap1); + +static int +des_set_key(des_cblock *key, des_key_schedule schedule) + { + register unsigned long c,d,t,s; + register unsigned char *in; + register unsigned long *k; + register int i; + + k=(unsigned long *)schedule; + in=(unsigned char *)key; + + c2l(in,c); + c2l(in,d); + + /* I now do it in 47 simple operations :-) + * Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov) + * for the inspiration. :-) */ + PERM_OP (d,c,t,4,0x0f0f0f0f); + HPERM_OP(c,t,-2,0xcccc0000); + HPERM_OP(d,t,-2,0xcccc0000); + PERM_OP (d,c,t,1,0x55555555); + PERM_OP (c,d,t,8,0x00ff00ff); + PERM_OP (d,c,t,1,0x55555555); + d= (((d&0x000000ff)<<16)| (d&0x0000ff00) | + ((d&0x00ff0000)>>16)|((c&0xf0000000)>>4)); + c&=0x0fffffff; + + for (i=0; i>2)|(c<<26)); d=((d>>2)|(d<<26)); } + else + { c=((c>>1)|(c<<27)); d=((d>>1)|(d<<27)); } + c&=0x0fffffff; + d&=0x0fffffff; + /* could be a few less shifts but I am to lazy at this + * point in time to investigate */ + s= skb[0][ (c )&0x3f ]| + skb[1][((c>> 6)&0x03)|((c>> 7)&0x3c)]| + skb[2][((c>>13)&0x0f)|((c>>14)&0x30)]| + skb[3][((c>>20)&0x01)|((c>>21)&0x06) | + ((c>>22)&0x38)]; + t= skb[4][ (d )&0x3f ]| + skb[5][((d>> 7)&0x03)|((d>> 8)&0x3c)]| + skb[6][ (d>>15)&0x3f ]| + skb[7][((d>>21)&0x0f)|((d>>22)&0x30)]; + + /* table contained 0213 4657 */ + *(k++)=((t<<16)|(s&0x0000ffff))&0xffffffff; + s= ((s>>16)|(t&0xffff0000)); + + s=(s<<4)|(s>>28); + *(k++)=s&0xffffffff; + } + return(0); + } + +/****************************************************************** + * modified stuff for crypt. + ******************************************************************/ + +/* The changes to this macro may help or hinder, depending on the + * compiler and the achitecture. gcc2 always seems to do well :-). + * Inspired by Dana How + * DO NOT use the alternative version on machines with 8 byte longs. + */ +#ifdef ALT_ECB +#define D_ENCRYPT(L,R,S) \ + v=(R^(R>>16)); \ + u=(v&E0); \ + v=(v&E1); \ + u=((u^(u<<16))^R^s[S ])<<2; \ + t=(v^(v<<16))^R^s[S+1]; \ + t=(t>>2)|(t<<30); \ + L^= \ + *(unsigned long *)(des_SP+0x0100+((t )&0xfc))+ \ + *(unsigned long *)(des_SP+0x0300+((t>> 8)&0xfc))+ \ + *(unsigned long *)(des_SP+0x0500+((t>>16)&0xfc))+ \ + *(unsigned long *)(des_SP+0x0700+((t>>24)&0xfc))+ \ + *(unsigned long *)(des_SP+ ((u )&0xfc))+ \ + *(unsigned long *)(des_SP+0x0200+((u>> 8)&0xfc))+ \ + *(unsigned long *)(des_SP+0x0400+((u>>16)&0xfc))+ \ + *(unsigned long *)(des_SP+0x0600+((u>>24)&0xfc)); +#else /* original version */ +#define D_ENCRYPT(L,R,S) \ + v=(R^(R>>16)); \ + u=(v&E0); \ + v=(v&E1); \ + u=(u^(u<<16))^R^s[S ]; \ + t=(v^(v<<16))^R^s[S+1]; \ + t=(t>>4)|(t<<28); \ + L^= SPtrans[1][(t )&0x3f]| \ + SPtrans[3][(t>> 8)&0x3f]| \ + SPtrans[5][(t>>16)&0x3f]| \ + SPtrans[7][(t>>24)&0x3f]| \ + SPtrans[0][(u )&0x3f]| \ + SPtrans[2][(u>> 8)&0x3f]| \ + SPtrans[4][(u>>16)&0x3f]| \ + SPtrans[6][(u>>24)&0x3f]; +#endif + +unsigned char con_salt[128]={ +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, +0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09, +0x0A,0x0B,0x05,0x06,0x07,0x08,0x09,0x0A, +0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12, +0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A, +0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22, +0x23,0x24,0x25,0x20,0x21,0x22,0x23,0x24, +0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C, +0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34, +0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C, +0x3D,0x3E,0x3F,0x00,0x00,0x00,0x00,0x00, +}; + +unsigned char cov_2char[64]={ +0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, +0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44, +0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C, +0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54, +0x55,0x56,0x57,0x58,0x59,0x5A,0x61,0x62, +0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A, +0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72, +0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A +}; + +char * +des_fcrypt(const char *buf, const char *salt, char *buff) + { + unsigned int i,j,x,y; + unsigned long Eswap0=0,Eswap1=0; + unsigned long out[2],ll; + des_cblock key; + des_key_schedule ks; + unsigned char bb[9]; + unsigned char *b=bb; + unsigned char c,u; + + /* eay 25/08/92 + * If you call crypt("pwd","*") as often happens when you + * have * as the pwd field in /etc/passwd, the function + * returns *\0XXXXXXXXX + * The \0 makes the string look like * so the pwd "*" would + * crypt to "*". This was found when replacing the crypt in + * our shared libraries. People found that the disbled + * accounts effectivly had no passwd :-(. */ + x=buff[0]=((salt[0] == '\0')?'A':salt[0]); + Eswap0=con_salt[x]; + x=buff[1]=((salt[1] == '\0')?'A':salt[1]); + Eswap1=con_salt[x]<<4; + + for (i=0; i<8; i++) + { + c= *(buf++); + if (!c) break; + key[i]=(c<<1); + } + for (; i<8; i++) + key[i]=0; + + des_set_key((des_cblock *)(key),ks); + body(&out[0],&out[1],ks,Eswap0,Eswap1); + + ll=out[0]; l2c(ll,b); + ll=out[1]; l2c(ll,b); + y=0; + u=0x80; + bb[8]=0; + for (i=2; i<13; i++) + { + c=0; + for (j=0; j<6; j++) + { + c<<=1; + if (bb[y] & u) c|=1; + u>>=1; + if (!u) + { + y++; + u=0x80; + } + } + buff[i]=cov_2char[c]; + } + buff[13]='\0'; + return buff; + } + +static int +body( unsigned long *out0, + unsigned long *out1, + des_key_schedule ks, + unsigned long Eswap0, + unsigned long Eswap1) + { + register unsigned long l,r,t,u,v; +#ifdef ALT_ECB + register unsigned char *des_SP=(unsigned char *)SPtrans; +#endif + register unsigned long *s; + register int i,j; + register unsigned long E0,E1; + + l=0; + r=0; + + s=(unsigned long *)ks; + E0=Eswap0; + E1=Eswap1; + + for (j=0; j<25; j++) + { + for (i=0; i<(ITERATIONS*2); i+=4) + { + D_ENCRYPT(l,r, i); /* 1 */ + D_ENCRYPT(r,l, i+2); /* 2 */ + } + t=l; + l=r; + r=t; + } + t=r; + r=(l>>1)|(l<<31); + l=(t>>1)|(t<<31); + /* clear the top bits on machines with 8byte longs */ + l&=0xffffffff; + r&=0xffffffff; + + PERM_OP(r,l,t, 1,0x55555555); + PERM_OP(l,r,t, 8,0x00ff00ff); + PERM_OP(r,l,t, 2,0x33333333); + PERM_OP(l,r,t,16,0x0000ffff); + PERM_OP(r,l,t, 4,0x0f0f0f0f); + + *out0=l; + *out1=r; + return(0); + } + diff -ruN perl-5.6.0/win32/makefile.mk AP615_source/win32/makefile.mk --- perl-5.6.0/win32/makefile.mk Wed Jul 5 14:34:48 2000 +++ AP615_source/win32/makefile.mk Wed Jul 5 12:22:23 2000 @@ -21,8 +21,8 @@ # Set these to wherever you want "dmake install" to put your # newly built perl. # -INST_DRV *= c: -INST_TOP *= $(INST_DRV)\perl +INST_DRV *= p: +INST_TOP *= $(INST_DRV)\Apps\Gecko\temp # # Comment this out if you DON'T want your perl installation to be versioned. @@ -33,7 +33,7 @@ # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -INST_VER *= \5.6.0 +#INST_VER *= \5.6.0 # # Comment this out if you DON'T want your perl installation to have @@ -44,27 +44,27 @@ # the same location. Commenting it out gives you a simpler # installation that is easier to understand for beginners. # -INST_ARCH *= \$(ARCHNAME) +#INST_ARCH *= \$(ARCHNAME) # # uncomment to enable multiple interpreters. This is need for fork() # emulation. # -#USE_MULTI *= define +USE_MULTI *= define # # Beginnings of interpreter cloning/threads; still very incomplete. # This should be enabled to get the fork() emulation. This needs # USE_MULTI as well. # -#USE_ITHREADS *= define +USE_ITHREADS *= define # # uncomment to enable the implicit "host" layer for all system calls # made by perl. This needs USE_MULTI above. This is also needed to # get fork(). # -#USE_IMP_SYS *= define +USE_IMP_SYS *= define # # WARNING! This option is deprecated and will eventually go away (enable @@ -138,7 +138,7 @@ # file exists (see README.win32). File should be located in the same # directory as this file. # -#CRYPT_SRC *= fcrypt.c +CRYPT_SRC *= fcrypt.c # # if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a @@ -210,7 +210,7 @@ # set this to your email address (perl will guess a value from # from your loginname and your hostname, which may not be right) # -#EMAIL *= +EMAIL *= support@activestate.com ## ## Build configuration ends. @@ -427,8 +427,8 @@ LIBC = PerlCRT.lib .ENDIF -PERLEXE_RES = -PERLDLL_RES = +PERLEXE_RES = perlexe.res +PERLDLL_RES = perldll.res .IF "$(CFG)" == "Debug" .IF "$(CCTYPE)" == "MSVC20" @@ -1070,7 +1070,7 @@ $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES) .ELSE - $(LINK32) -subsystem:console -out:$@ -stack:0x8000000 $(BLINK_FLAGS) \ + $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(BLINK_FLAGS) \ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) .ENDIF copy $(PERLEXE) $(WPERLEXE) @@ -1209,10 +1209,10 @@ -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm -del /f $(LIBDIR)\File\Glob.pm - -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO - -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread - -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B - -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data + -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO + -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread + -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B + -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data -del /f $(PODDIR)\*.html -del /f $(PODDIR)\*.bat -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \ @@ -1223,8 +1223,8 @@ -del /f bin\*.bat -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \ pm_to_blib - -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) - -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) + -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) + -if exist $(COREDIR) rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) install : all installbare installhtml @@ -1291,7 +1291,7 @@ -@erase $(WPERLEXE) -@erase $(PERLDLL) -@erase $(CORE_OBJ) - -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) + -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR) -@erase $(WIN32_OBJ) -@erase $(DLL_OBJ) -@erase $(X2P_OBJ) Binary files perl-5.6.0/win32/perldll.ico and AP615_source/win32/perldll.ico differ diff -ruN perl-5.6.0/win32/perldll.rc AP615_source/win32/perldll.rc --- perl-5.6.0/win32/perldll.rc Wed Dec 31 16:00:00 1969 +++ AP615_source/win32/perldll.rc Thu May 25 01:14:41 2000 @@ -0,0 +1,52 @@ +// PerlDll.rc + +// (c) 1995-1998 Microsoft Corporation. All rights reserved. +// Developed by ActiveState Tool Corp., http://www.ActiveState.com + +// You may distribute under the terms of either the GNU General Public +// License or the Artistic License, as specified in the README file. + +#include +#include "BuildInfo.h" + +PERLDLL ICON PerlDll.ico + +#ifndef _DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION PERLRC_VERSION + PRODUCTVERSION PERLRC_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS VER_DEBUG + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + +BEGIN +BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "ActiveState Tool Corp.\0", + VALUE "FileDescription", "Perl Interpreter\0", + VALUE "FileVersion", PERLFILEVERSION, + VALUE "InternalName", "Perl56.dll\0", + VALUE "LegalCopyright", "Copyright 1987-1999, Larry Wall, Binary build by ActiveState Tool Corp., http://www.ActiveState.com\0", + VALUE "LegalTrademarks", "\0", + VALUE "OriginalFilename", "Perl56.dll\0", + VALUE "ProductName", "ActivePerl\0", + VALUE "ProductVersion", PERLPRODUCTVERSION, + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 0x04E4 + // English language (0x409) and the Windows ANSI codepage (0x04E4) + END +END + Binary files perl-5.6.0/win32/perlexe.ico and AP615_source/win32/perlexe.ico differ diff -ruN perl-5.6.0/win32/perlexe.rc AP615_source/win32/perlexe.rc --- perl-5.6.0/win32/perlexe.rc Wed Dec 31 16:00:00 1969 +++ AP615_source/win32/perlexe.rc Thu May 25 01:14:41 2000 @@ -0,0 +1,52 @@ +// PerlExe.rc + +// (c) 1995-1999 Microsoft Corporation. All rights reserved. +// Developed by ActiveState Tool Corp., http://www.ActiveState.com + +// You may distribute under the terms of either the GNU General Public +// License or the Artistic License, as specified in the README file. + +#include +#include "BuildInfo.h" + +PERLEXE ICON PerlExe.ico + +#ifndef _DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION PERLRC_VERSION + PRODUCTVERSION PERLRC_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS VER_DEBUG + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN + +BEGIN +BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "ActiveState Tool Corp.\0", + VALUE "FileDescription", "Perl Command Line Interpreter\0", + VALUE "FileVersion", PERLFILEVERSION, + VALUE "InternalName", "Perl.exe\0", + VALUE "LegalCopyright", "Copyright 1987-1999, Larry Wall, Binary build by ActiveState Tool Corp., http://www.ActiveState.com\0", + VALUE "LegalTrademarks", "\0", + VALUE "OriginalFilename", "Perl.exe\0", + VALUE "ProductName", "ActivePerl\0", + VALUE "ProductVersion", PERLPRODUCTVERSION, + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 0x04E4 + // English language (0x409) and the Windows ANSI codepage (0x04E4) + END +END + diff -ruN perl-5.6.0/win32/perlhost.h AP615_source/win32/perlhost.h --- perl-5.6.0/win32/perlhost.h Wed Jul 5 14:34:48 2000 +++ AP615_source/win32/perlhost.h Thu Jun 29 08:32:57 2000 @@ -10,6 +10,7 @@ #ifndef ___PerlHost_H___ #define ___PerlHost_H___ +#include #include "iperlsys.h" #include "vmem.h" #include "vdir.h" @@ -1639,7 +1640,7 @@ Sighandler_t PerlProcSignal(struct IPerlProc* piPerl, int sig, Sighandler_t subcode) { - return 0; + return signal(sig, subcode); } #ifdef USE_ITHREADS @@ -1770,8 +1771,10 @@ (LPVOID)new_perl, 0, &id); # endif PERL_SET_THX(aTHXo); /* XXX perl_clone*() set TLS */ - if (!handle) - Perl_croak(aTHX_ "panic: pseudo fork() failed"); + if (!handle) { + errno = EAGAIN; + return -1; + } w32_pseudo_child_handles[w32_num_pseudo_children] = handle; w32_pseudo_child_pids[w32_num_pseudo_children] = id; ++w32_num_pseudo_children; diff -ruN perl-5.6.0/win32/perllib.c AP615_source/win32/perllib.c --- perl-5.6.0/win32/perllib.c Wed Jul 5 14:34:48 2000 +++ AP615_source/win32/perllib.c Thu Jun 29 08:25:41 2000 @@ -338,6 +338,10 @@ EXTERN_C void set_w32_module_name(void); +EXTERN_C void +EndSockets(void); + + #ifdef __MINGW32__ EXTERN_C /* GCC in C++ mode mangles the name, otherwise */ #endif @@ -367,6 +371,7 @@ * process termination or call to FreeLibrary. */ case DLL_PROCESS_DETACH: + EndSockets(); break; /* The attached process creates a new thread. */ diff -ruN perl-5.6.0/win32/vdir.h AP615_source/win32/vdir.h --- perl-5.6.0/win32/vdir.h Wed Jul 5 14:34:48 2000 +++ AP615_source/win32/vdir.h Thu May 25 01:14:41 2000 @@ -10,7 +10,11 @@ #ifndef ___VDir_H___ #define ___VDir_H___ -const int driveCount = 30; +/* + * Allow one slot for each possible drive letter + * and one additional slot for a UNC name + */ +const int driveCount = ('Z'-'A')+1+1; class VDir { @@ -105,6 +109,8 @@ inline int DriveIndex(char chr) { + if (chr == '\\' || chr == '/') + return ('Z'-'A')+1; return (chr | 0x20)-'a'; }; @@ -366,8 +372,12 @@ */ char szBuffer[(MAX_PATH+1)*2]; char szlBuf[MAX_PATH+1]; + int length = strlen(pInName); - if (strlen(pInName) > MAX_PATH) { + if (!length) + return (char*)pInName; + + if (length > MAX_PATH) { strncpy(szlBuf, pInName, MAX_PATH); if (IsPathSep(pInName[0]) && !IsPathSep(pInName[1])) { /* absolute path - reduce length by 2 for drive specifier */ @@ -430,32 +440,23 @@ int VDir::SetCurrentDirectoryA(char *lpBuffer) { - HANDLE hHandle; - WIN32_FIND_DATA win32FD; - char szBuffer[MAX_PATH+1], *pPtr; + char *pPtr; int length, nRet = -1; - GetFullPathNameA(MapPathA(lpBuffer), sizeof(szBuffer), szBuffer, &pPtr); - /* if the last char is a '\\' or a '/' then add - * an '*' before calling FindFirstFile - */ - length = strlen(szBuffer); - if(length > 0 && IsPathSep(szBuffer[length-1])) { - szBuffer[length] = '*'; - szBuffer[length+1] = '\0'; + pPtr = MapPathA(lpBuffer); + length = strlen(pPtr); + if(length > 3 && IsPathSep(pPtr[length-1])) { + /* don't remove the trailing slash from 'x:\' */ + pPtr[length-1] = '\0'; } - hHandle = FindFirstFileA(szBuffer, &win32FD); - if (hHandle != INVALID_HANDLE_VALUE) { - FindClose(hHandle); - - /* if an '*' was added remove it */ - if(szBuffer[length] == '*') - szBuffer[length] = '\0'; - - SetDefaultDirA(szBuffer, DriveIndex(szBuffer[0])); + DWORD r = GetFileAttributesA(pPtr); + if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY)) + { + SetDefaultDirA(pPtr, DriveIndex(pPtr[0])); nRet = 0; } + return nRet; } @@ -590,8 +591,12 @@ */ WCHAR szBuffer[(MAX_PATH+1)*2]; WCHAR szlBuf[MAX_PATH+1]; + int length = wcslen(pInName); - if (wcslen(pInName) > MAX_PATH) { + if (!length) + return (WCHAR*)pInName; + + if (length > MAX_PATH) { wcsncpy(szlBuf, pInName, MAX_PATH); if (IsPathSep(pInName[0]) && !IsPathSep(pInName[1])) { /* absolute path - reduce length by 2 for drive specifier */ @@ -653,32 +658,23 @@ int VDir::SetCurrentDirectoryW(WCHAR *lpBuffer) { - HANDLE hHandle; - WIN32_FIND_DATAW win32FD; - WCHAR szBuffer[MAX_PATH+1], *pPtr; + WCHAR *pPtr; int length, nRet = -1; - GetFullPathNameW(MapPathW(lpBuffer), (sizeof(szBuffer)/sizeof(WCHAR)), szBuffer, &pPtr); - /* if the last char is a '\\' or a '/' then add - * an '*' before calling FindFirstFile - */ - length = wcslen(szBuffer); - if(length > 0 && IsPathSep(szBuffer[length-1])) { - szBuffer[length] = '*'; - szBuffer[length+1] = '\0'; + pPtr = MapPathW(lpBuffer); + length = wcslen(pPtr); + if(length > 3 && IsPathSep(pPtr[length-1])) { + /* don't remove the trailing slash from 'x:\' */ + pPtr[length-1] = '\0'; } - hHandle = FindFirstFileW(szBuffer, &win32FD); - if (hHandle != INVALID_HANDLE_VALUE) { - FindClose(hHandle); - - /* if an '*' was added remove it */ - if(szBuffer[length] == '*') - szBuffer[length] = '\0'; - - SetDefaultDirW(szBuffer, DriveIndex((char)szBuffer[0])); + DWORD r = GetFileAttributesW(pPtr); + if ((r != 0xffffffff) && (r & FILE_ATTRIBUTE_DIRECTORY)) + { + SetDefaultDirW(pPtr, DriveIndex((char)pPtr[0])); nRet = 0; } + return nRet; } diff -ruN perl-5.6.0/win32/win32.c AP615_source/win32/win32.c --- perl-5.6.0/win32/win32.c Wed Jul 5 14:34:48 2000 +++ AP615_source/win32/win32.c Thu Jun 29 08:32:49 2000 @@ -177,7 +177,9 @@ if (retval == ERROR_SUCCESS) { DWORD datalen; retval = RegQueryValueEx(handle, valuename, 0, &type, NULL, &datalen); - if (retval == ERROR_SUCCESS && type == REG_SZ) { + if (retval == ERROR_SUCCESS + && (type == REG_SZ || type == REG_EXPAND_SZ)) + { dTHXo; if (!*svp) *svp = sv_2mortal(newSVpvn("",0)); @@ -1755,7 +1757,7 @@ dTHXo; KillTimer(NULL,timerid); timerid=0; - sighandler(14); + CALL_FPTR(PL_sighandlerp)(14); } #endif /* !PERL_OBJECT */ @@ -3522,6 +3524,13 @@ */ static +XS(w32_BuildNumber) +{ + dXSARGS; + XSRETURN_PV(PRODUCT_BUILD_NUMBER); +} + +static XS(w32_GetCwd) { dXSARGS; @@ -3966,18 +3975,6 @@ char *file = __FILE__; dXSUB_SYS; - w32_perlshell_tokens = Nullch; - w32_perlshell_items = -1; - w32_fdpid = newAV(); /* XXX needs to be in Perl_win32_init()? */ - New(1313, w32_children, 1, child_tab); - w32_num_children = 0; - w32_init_socktype = 0; -#ifdef USE_ITHREADS - w32_pseudo_id = 0; - New(1313, w32_pseudo_children, 1, child_tab); - w32_num_pseudo_children = 0; -#endif - /* these names are Activeware compatible */ newXS("Win32::GetCwd", w32_GetCwd, file); newXS("Win32::SetCwd", w32_SetCwd, file); @@ -3999,6 +3996,7 @@ newXS("Win32::GetLongPathName", w32_GetLongPathName, file); newXS("Win32::CopyFile", w32_CopyFile, file); newXS("Win32::Sleep", w32_Sleep, file); + newXS("Win32::BuildNumber", w32_BuildNumber, file); /* XXX Bloat Alert! The following Activeware preloads really * ought to be part of Win32::Sys::*, so they're not included @@ -4035,16 +4033,36 @@ ptbl->childStdErr = GetStdHandle(STD_ERROR_HANDLE); } - -#ifdef USE_ITHREADS +#ifdef HAVE_INTERP_INTERN # ifdef PERL_OBJECT +# undef Perl_sys_intern_init +# define Perl_sys_intern_init CPerlObj::Perl_sys_intern_init # undef Perl_sys_intern_dup # define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup # define pPerl this # endif void +Perl_sys_intern_init(pTHX) +{ + w32_perlshell_tokens = Nullch; + w32_perlshell_vec = (char**)NULL; + w32_perlshell_items = 0; + w32_fdpid = newAV(); + New(1313, w32_children, 1, child_tab); + w32_num_children = 0; +# ifdef USE_ITHREADS + w32_pseudo_id = 0; + New(1313, w32_pseudo_children, 1, child_tab); + w32_num_pseudo_children = 0; +# endif + w32_init_socktype = 0; +} + +# ifdef USE_ITHREADS + +void Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst) { dst->perlshell_tokens = Nullch; @@ -4052,12 +4070,12 @@ dst->perlshell_items = 0; dst->fdpid = newAV(); Newz(1313, dst->children, 1, child_tab); - Newz(1313, dst->pseudo_children, 1, child_tab); dst->pseudo_id = 0; - dst->children->num = 0; + Newz(1313, dst->pseudo_children, 1, child_tab); dst->thr_intern.Winit_socktype = src->thr_intern.Winit_socktype; } -#endif +# endif /* USE_ITHREADS */ +#endif /* HAVE_INTERP_INTERN */ #ifdef PERL_OBJECT # undef this diff -ruN perl-5.6.0/win32/win32.h AP615_source/win32/win32.h --- perl-5.6.0/win32/win32.h Wed Jul 5 14:34:49 2000 +++ AP615_source/win32/win32.h Thu May 25 01:14:41 2000 @@ -9,6 +9,8 @@ #ifndef _INC_WIN32_PERL5 #define _INC_WIN32_PERL5 +#include "BuildInfo.h" + #ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */ #endif diff -ruN perl-5.6.0/win32/win32sck.c AP615_source/win32/win32sck.c --- perl-5.6.0/win32/win32sck.c Wed Jul 5 14:34:49 2000 +++ AP615_source/win32/win32sck.c Thu Jun 29 08:25:41 2000 @@ -56,12 +56,6 @@ } STMT_END #endif -#define EndSockets() \ - STMT_START { \ - if (wsock_started) \ - WSACleanup(); \ - } STMT_END - #define SOCKET_TEST(x, y) \ STMT_START { \ StartSockets(); \ @@ -76,6 +70,13 @@ const char *proto); static int wsock_started = 0; + +EXTERN_C void +EndSockets(void) +{ + if (wsock_started) + WSACleanup(); +} void start_sockets(void) End of Patch. Detailed change log entries follow. ____________________________________________________________________________ [ 6318] By: gsar on 2000/07/05 22:10:54 Log: fix UNC path handling on Windows under ithreads, and chdir() return value when given a non-existent directory Branch: perl ! win32/vdir.h ____________________________________________________________________________ [ 6317] By: gsar on 2000/07/05 22:08:19 Log: winsock cleanup never done on Windows (leads to handle leaks) Branch: perl ! win32/perllib.c win32/win32sck.c ____________________________________________________________________________ [ 6316] By: gsar on 2000/07/05 22:06:19 Log: some debugger output does not go to the socket when RemotePort is set Branch: perl ! lib/perl5db.pl ____________________________________________________________________________ [ 6216] By: gsar on 2000/06/08 14:54:21 Log: be more optimal about clearing @_ Branch: perl ! cop.h ____________________________________________________________________________ [ 6215] By: gsar on 2000/06/08 14:33:04 Log: tweak comment about @DB::args Branch: perl ! av.h pp_ctl.c ____________________________________________________________________________ [ 6214] By: gsar on 2000/06/08 13:57:54 Log: @_ can't have junk in it even in the non-USE_ITHREADS case because caller() wants to populate @DB::args with it (causes a coredump in Carp::confess()) Branch: perl ! cop.h t/op/runlevel.t ____________________________________________________________________________ [ 6201] By: gsar on 2000/06/06 00:42:59 Log: Perl_eval_pv() leaks 4 bytes every time it is called because it does a PUSHMARK that's never ever POPMARKed; in general, only Perl_call_[sp]v() need a PUSHMARK for incoming arguments; Perl_eval_[sp]v() don't because they don't take any incoming arguments (this leak has been around since the original version of perl_eval_pv() in 5.003_97e) Branch: perl ! perl.c ____________________________________________________________________________ [ 6195] By: gsar on 2000/06/02 22:43:13 Log: fix yet another eval"" leak under USE_ITHREADS Branch: perl ! op.c ____________________________________________________________________________ [ 6194] By: gsar on 2000/06/02 18:22:06 Log: fix small eval"" memory leaks under USE_ITHREADS Branch: perl ! cop.h embed.h embed.pl objXSUB.h op.c perl.c perlapi.c perly.c ! perly_c.diff pp_ctl.c proto.h scope.c scope.h sv.c toke.c ! vms/perly_c.vms ____________________________________________________________________________ [ 6191] By: gsar on 2000/06/01 09:38:21 Log: vec() loses numericalness (modified version of patch suggested by Robin Barker) Branch: perl ! doop.c t/op/vec.t ____________________________________________________________________________ [ 6184] By: gsar on 2000/06/01 07:52:27 Log: tweak for change#6127 Branch: perl ! perl.c ____________________________________________________________________________ [ 6179] By: gsar on 2000/05/31 22:37:51 Log: buggy modulus on UVs introduced by change#3378 (resulted in 4063328477 % 65535 amounting to 27406, instead of 27407) Branch: perl ! pp.c t/op/arith.t ____________________________________________________________________________ [ 6172] By: gsar on 2000/05/31 05:05:42 Log: fix buggy multiline matching of C<"a\nxb\n" =~ /(?!\A)x/m> (from Ilya Zakharevich) Branch: perl ! regexec.c t/op/re_tests ____________________________________________________________________________ [ 6170] By: gsar on 2000/05/31 04:41:33 Log: change#6142 needs tweaks to tests to work where there's no symlink() (from Helmut Jarausch ) Branch: perl ! t/lib/filefind.t ____________________________________________________________________________ [ 6163] By: gsar on 2000/05/30 03:24:03 Log: fix memory leak in C (bug in change#4579) Branch: perl ! op.c ____________________________________________________________________________ [ 6162] By: gsar on 2000/05/30 03:09:38 Log: fix memory leak in method call optimization (change#3768); made Cfoo()"> leak Branch: perl ! op.c ____________________________________________________________________________ [ 6154] By: gsar on 2000/05/28 21:04:19 Log: avoid type mismatch warning Branch: perl ! perl.c ____________________________________________________________________________ [ 6152] By: gsar on 2000/05/28 20:53:42 Log: cosmetic fixups of RE debug output (from Ilya Zakharevich) Branch: perl ! regexec.c ____________________________________________________________________________ [ 6151] By: gsar on 2000/05/28 20:50:28 Log: fix accidental pessimization in RE optimizer (from Ilya Zakharevich) Branch: perl ! regexec.c ____________________________________________________________________________ [ 6148] By: gsar on 2000/05/28 20:21:07 Log: close open file before chmod() (from Rocco Caputo ) Branch: perl ! lib/ExtUtils/MM_Unix.pm ____________________________________________________________________________ [ 6142] By: gsar on 2000/05/28 18:21:51 Log: File::Find fails to chdir when chasing symlinks (from Helmut Jarausch ) Branch: perl ! lib/File/Find.pm t/lib/filefind.t ____________________________________________________________________________ [ 6137] By: gsar on 2000/05/28 08:46:10 Log: fix bogus redeclaration warning for "our" variables in different scopes Branch: perl ! op.c t/pragma/strict-vars ____________________________________________________________________________ [ 6133] By: gsar on 2000/05/28 08:08:05 Log: elide bogus test in change#6132 Branch: perl ! t/pragma/warn/9enabled ____________________________________________________________________________ [ 6132] By: gsar on 2000/05/28 08:03:14 Log: warnings::enabled() doesn't fall back to looking at $^W if caller isn't using lexical warnings (from Paul Marquess) Branch: perl ! pp_ctl.c t/pragma/warn/9enabled ____________________________________________________________________________ [ 6131] By: gsar on 2000/05/28 07:57:47 Log: avoid warnings in POSIX.pm (from Barrie Slaymaker) Branch: perl ! ext/POSIX/POSIX.pm ____________________________________________________________________________ [ 6127] By: gsar on 2000/05/28 07:02:50 Log: call_method(...,G_EVAL) can longjmp() out if the method probing failed (from Gisle Aas) Branch: perl ! cop.h perl.c ____________________________________________________________________________ [ 6126] By: gsar on 2000/05/28 06:39:53 Log: change#2879 broke rvalue autovivification of magicals such as ${$num} (reworked variant of patch suggested by Simon Cozens) Branch: perl ! embed.h embed.pl gv.c pod/perlapi.pod pod/perlintern.pod pp.c ! pp_hot.c proto.h t/op/gv.t ____________________________________________________________________________ [ 6125] By: gsar on 2000/05/28 05:14:55 Log: enable propagating exception objects via Perl_croak() in XS code (from Gisle Aas) Branch: perl ! util.c ____________________________________________________________________________ [ 6108] By: gsar on 2000/05/17 02:24:56 Log: reenable fake signal handling on Windows, bugs and all Branch: perl ! mg.c perl.h win32/perlhost.h ____________________________________________________________________________ [ 6104] By: gsar on 2000/05/11 03:39:07 Log: PL_sys_intern was being initialized too late on windows Branch: perl ! embed.h embed.pl global.sym makedef.pl objXSUB.h perl.c ! perlapi.c pod/perlapi.pod proto.h win32/win32.c ____________________________________________________________________________ [ 6093] By: gsar on 2000/05/08 12:52:28 Log: fork() failure to create pseudo process sets errno=EAGAIN and returns undef on windows (from Clinton Pierce ) Branch: perl ! pp_sys.c sv.c win32/perlhost.h ____________________________________________________________________________ [ 6090] By: gsar on 2000/05/07 19:47:07 Log: concat doesn't preserve utf8-ness, and doesn't invalidate [NI]OK; added tests for both Branch: perl ! perl.c pp_hot.c sv.c t/op/substr.t ____________________________________________________________________________ [ 6087] By: gsar on 2000/05/07 16:05:16 Log: reverse() and quotemeta() weren't preserving utf8-ness; add tests Branch: perl ! pp.c sv.c t/op/quotemeta.t t/op/substr.t toke.c ____________________________________________________________________________ [ 6085] By: gsar on 2000/05/07 05:52:02 Log: repeat operator (x) doesn't preserve utf8-ness Branch: perl ! pp.c t/op/substr.t ____________________________________________________________________________ [ 6084] By: gsar on 2000/05/07 05:39:55 Log: substr() does not preserve utf8-ness (from Stefan Eissing ); added tests Branch: perl ! pp.c t/op/substr.t ____________________________________________________________________________ [ 6079] By: gsar on 2000/05/07 04:01:38 Log: remove outdated kludge in Carp (NULLs are permitted in diagnostics now) Branch: perl ! lib/Carp/Heavy.pm ____________________________________________________________________________ [ 6067] By: gsar on 2000/05/05 01:33:09 Log: replace direct call to sighandler() with (*PL_sighandlerp)() Branch: perl ! win32/win32.c ____________________________________________________________________________ [ 6066] By: gsar on 2000/05/05 01:23:43 Log: s/END/CHECK/ Branch: perl ! perl.c ____________________________________________________________________________ [ 6063] By: gsar on 2000/05/04 16:52:29 Log: tokeq() could read unallocated field in argument Branch: perl ! toke.c ____________________________________________________________________________ [ 6062] By: gsar on 2000/05/04 16:34:51 Log: additional tests for utf8.t Branch: perl ! t/pragma/utf8.t ____________________________________________________________________________ [ 6061] By: gsar on 2000/05/04 16:09:28 Log: change#5921 neglected to make eq honor "use bytes" Branch: perl ! sv.c ____________________________________________________________________________ [ 6058] By: gsar on 2000/05/04 00:19:14 Log: printf(...) should be PerlIO_printf(PerlIO_stdout(), ...) (spotted by Donald Kinzer ) Branch: perl ! perl.c ____________________________________________________________________________ [ 6057] By: gsar on 2000/05/03 18:34:01 Log: fix broken parsing of /\x{ab}/ Branch: perl ! regcomp.c t/pragma/utf8.t ____________________________________________________________________________ [ 6044] By: gsar on 2000/05/02 06:48:19 Log: change#3798 broke the meaning of "\0_7_7", tr/\0_// etc.; fix it such that underscores are only ignored in literal numbers, "\x{...}", and hex/oct argument Branch: perl ! perl.c pp.c regcomp.c t/op/oct.t toke.c util.c ____________________________________________________________________________ [ 6030] By: gsar on 2000/05/01 08:39:18 Log: introduce @LAST_MATCH_START and @LAST_MATCH_END, English aliases for @- and @+ (from Johan Vromans) Branch: perl ! lib/English.pm pod/perlvar.pod ____________________________________________________________________________ [ 6022] By: gsar on 2000/04/30 16:59:22 Log: unbalanced LEAVE after perl_clone(...,0) (from Doug MacEachern) Branch: perl ! sv.c ____________________________________________________________________________ [ 6021] By: gsar on 2000/04/29 21:00:08 Log: remove Win2K issue in pod (fixed by change#6020) Branch: perl ! README.win32 pod/perl56delta.pod ____________________________________________________________________________ [ 6020] By: gsar on 2000/04/29 20:51:49 Log: test tweak Branch: perl ! t/lib/open3.t ____________________________________________________________________________ [ 6018] By: gsar on 2000/04/29 19:55:24 Log: make lib/syslog.t portable to systems that don't have _PATH_LOG, make _PATH_LOG() return "" if unavailable Branch: perl ! ext/File/Glob/Glob.pm ext/Sys/Syslog/Syslog.pm ! ext/Sys/Syslog/Syslog.xs t/lib/syslog.t ____________________________________________________________________________ [ 6014] By: gsar on 2000/04/28 22:05:31 Log: glob() loading File::Glob behind the scenes may cause syntax errors Branch: perl ! op.c ____________________________________________________________________________ [ 6009] By: gsar on 2000/04/28 21:00:00 Log: IO::Poll bugs fixed (from Lincoln Stein ) Branch: perl ! ext/IO/lib/IO/Poll.pm t/lib/io_poll.t ____________________________________________________________________________ [ 6005] By: gsar on 2000/04/28 20:41:16 Log: perldoc might fail via "use blib" (from Hugo van der Sanden) Branch: perl ! utils/perldoc.PL ____________________________________________________________________________ [ 6003] By: gsar on 2000/04/28 20:11:20 Log: allow REG_EXPAND_SZ keys in Windows registry (from John Clayton ) Branch: perl ! win32/win32.c ____________________________________________________________________________ [ 6002] By: gsar on 2000/04/28 19:34:16 Log: destructive sv_setsv() can lose UV-ness from source, causing numeric promotions/comparisons to fail to do the right thing Branch: perl ! sv.c ____________________________________________________________________________ [ 5999] By: gsar on 2000/04/28 18:17:07 Log: fix line renumbering bug in C Branch: perl ! t/pragma/warn/toke toke.c ____________________________________________________________________________ [ 5995] By: gsar on 2000/04/28 09:37:36 Log: fixes for bugs in C (from Paul Marquess) Branch: perl ! mg.c t/pragma/warn/7fatal warnings.h warnings.pl ____________________________________________________________________________ [ 5990] By: gsar on 2000/04/28 08:54:52 Log: use $ENV{LIB} to search for libs under Visual C compiler on Windows (from Jochen Wiedmann ) Branch: perl ! lib/ExtUtils/Liblist.pm ____________________________________________________________________________ [ 5989] By: gsar on 2000/04/28 08:27:12 Log: qw(a\\b) must be parsed like 'a\\b', i.e., backslash escapes itself and no other (from Tom Hughes) Branch: perl ! t/op/array.t toke.c ____________________________________________________________________________ [ 5988] By: gsar on 2000/04/28 08:01:38 Log: s/HTMLSCRIPTPOD/HTMLSCRIPTPODS/ (from Paul Sharpe ) Branch: perl ! lib/ExtUtils/MakeMaker.pm ____________________________________________________________________________ [ 5985] By: gsar on 2000/04/28 07:30:28 Log: forked child may not exit correctly if it failed to open /dev/console (from Graham Barr) Branch: perl ! ext/Sys/Syslog/Syslog.pm ____________________________________________________________________________ [ 5983] By: gsar on 2000/04/28 07:15:04 Log: numeric conversion of non-number in change#3378 tramples on OOK offset, causing segfaults Branch: perl ! sv.c ____________________________________________________________________________ [ 5982] By: gsar on 2000/04/28 04:48:25 Log: avoid error in IO::Socket::INET when given an unknown service name with a port number (from Brian Raven ) Branch: perl ! ext/IO/lib/IO/Socket/INET.pm ____________________________________________________________________________ [ 5981] By: gsar on 2000/04/28 04:31:31 Log: rename File::Glob::glob() to File::Glob::bsd_glob() to avoid prototype mismatch with CORE::glob(); update pod and tests to suit (File::Glob::glob() is still available for backward compatibility, but should be considered deprecated) Branch: perl ! ext/File/Glob/Glob.pm t/lib/glob-basic.t t/lib/glob-case.t ! t/lib/glob-taint.t ____________________________________________________________________________ [ 5979] By: gsar on 2000/04/28 03:07:54 Log: under useithreads, constant pad entries could inadvertantly be shared across threads (from Eric Blood ); added Eric's test case to testsuite Branch: perl ! op.c t/op/misc.t ____________________________________________________________________________ [ 5975] By: gsar on 2000/04/27 20:34:24 Log: allow sort() reentrancy (variant of patch suggested by Hugo van der Sanden) Branch: perl ! pp_ctl.c t/op/sort.t ____________________________________________________________________________ [ 5974] By: gsar on 2000/04/27 19:46:57 Log: change#4197 somehow missed initializing PL_errors, meaning sytax error queueing wasn't working outside eval"" at all; also fixed eval"" to localize PL_error_count, so that compile-time eval's don't clobber the error state of the outer context Branch: perl ! lib/Math/Complex.pm perl.c pp_ctl.c t/pragma/warn/op ! t/pragma/warn/toke ____________________________________________________________________________ [ 5973] By: gsar on 2000/04/27 18:29:05 Log: fix for failure to match $foo =~ /(?i)/ (from Ilya Zakharevich) Branch: perl ! regcomp.c regexec.c t/op/re_tests ____________________________________________________________________________ [ 5970] By: gsar on 2000/04/27 18:05:11 Log: Data::Dumper fumbles negative numbers on 32-bit platforms where IV is >32bits Branch: perl ! ext/Data/Dumper/Dumper.xs t/lib/dumper.t ____________________________________________________________________________ [ 5969] By: gsar on 2000/04/27 17:50:56 Log: fix Sys::Syslog breakage on domain sockets (from Tom Hughes) Branch: perl + t/lib/syslog.t ! MANIFEST ext/Sys/Syslog/Syslog.pm ____________________________________________________________________________ [ 5965] By: gsar on 2000/04/27 16:10:37 Log: avoid "will not stay shared" warnings for our variables (from Robin Barker) Branch: perl ! op.c t/pragma/warn/op ____________________________________________________________________________ [ 5963] By: gsar on 2000/04/27 06:28:31 Log: patch from Larry to make (\&) prototype work; added tests for the same Branch: perl ! op.c t/comp/proto.t ____________________________________________________________________________ [ 5955] By: gsar on 2000/04/27 04:26:44 Log: longstanding bug exposed by change#3307: sort arguments weren't compiled with the right wantarray context (ensuing runtime lookup via block_gimme() was getting the incidental context of the sort() itself) Branch: perl ! op.c t/op/sort.t ____________________________________________________________________________ [ 5948] By: gsar on 2000/04/25 18:21:57 Log: typo in vars.pm that leads to cryptic message (from Piotr Piatkowski ) Branch: perl ! lib/vars.pm ____________________________________________________________________________ [ 5938] By: gsar on 2000/04/24 18:54:01 Log: Consolidated B::Deparse fixes (from Stephen McCamant) Branch: perl ! ext/B/B/Deparse.pm ____________________________________________________________________________ [ 5936] By: gsar on 2000/04/24 17:30:06 Log: additional tests for change#5934 (from Paul Marquess, who also sent in the same fix) Branch: perl ! t/pragma/warn/2use t/pragma/warn/3both t/pragma/warn/4lint ! t/pragma/warn/5nolint t/pragma/warn/6default ____________________________________________________________________________ [ 5934] By: gsar on 2000/04/24 17:16:54 Log: propagate lexical warnings from surrounding scope correctly within string eval() Branch: perl ! pp_ctl.c t/pragma/warn/pp_ctl ____________________________________________________________________________ [ 5932] By: gsar on 2000/04/24 09:08:14 Log: add rsignal(), whichsig() and do_join() to public API list (mod_perl uses them to good advantage) Branch: perl ! embed.pl global.sym objXSUB.h perlapi.c proto.h ____________________________________________________________________________ [ 5931] By: gsar on 2000/04/24 09:01:40 Log: fix RE brokenness on refs/overloaded things (from Ilya Zakharevich) Branch: perl ! pp_hot.c regexec.c t/op/pat.t ____________________________________________________________________________ [ 5927] By: gsar on 2000/04/24 08:43:24 Log: arrange for next() to resume at the unstack op rather than the loop conditional, so that scope cleanup happens correctly (from Stephen McCamant) Branch: perl ! op.c pp_ctl.c t/op/misc.t ____________________________________________________________________________ [ 5926] By: gsar on 2000/04/24 08:18:40 Log: on windows, reserve 16M of stack rather than 128M (allows more threads to run concurrently) Branch: perl ! win32/Makefile win32/makefile.mk ____________________________________________________________________________ [ 5924] By: gsar on 2000/04/24 08:08:59 Log: avoid using uninitialized memory in require version check Branch: perl ! pp_ctl.c universal.c ____________________________________________________________________________ [ 5921] By: gsar on 2000/04/24 06:58:26 Log: make eq unicode-aware (from Gisle Aas); fix bogus tests revealed by fix Branch: perl ! sv.c t/lib/charnames.t t/pragma/utf8.t ____________________________________________________________________________ [ 5920] By: gsar on 2000/04/24 06:37:59 Log: Larry's fix for buggy propagation of utf8-ness in join(); add test Branch: perl ! doop.c t/op/ver.t ____________________________________________________________________________ [ 5914] By: gsar on 2000/04/24 04:56:08 Log: caller() wasn't returning the right number of elements for eval {...} Branch: perl ! pp_ctl.c t/pragma/warn/9enabled ____________________________________________________________________________ [ 5913] By: gsar on 2000/04/24 04:35:41 Log: pod nit: $yday range for localtime/gmtime is 0..364 not 1..365 (from Mark-Jason Dominus) Branch: perl ! pod/perlfunc.pod ____________________________________________________________________________ [ 5912] By: gsar on 2000/04/24 04:17:15 Log: fix totally broken caching in UNIVERSAL::isa() (from Nick Ing-Simmons) Branch: perl ! t/op/universal.t universal.c ____________________________________________________________________________ [ 5909] By: gsar on 2000/04/24 03:22:03 Log: mode argument to do_binmode() should be file mode, not boolean Branch: perl ! pp_sys.c ____________________________________________________________________________ [ 5908] By: gsar on 2000/04/16 16:51:08 Log: introduce illegal symbols into null package so that gv_fetchpv(...,TRUE) always returns a valid GV even when the symbol is trapped by strictures (avoids coredumps) TODO: the C hack needs similar treatment Branch: perl ! embedvar.h gv.c intrpvar.h perl.c perlapi.h ! t/pragma/strict-vars