[inseparable changes from match from perl-5.003_97i to perl-5.003_97j]
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>
Sat, 26 Apr 1997 12:00:00 +0000 (00:00 +1200)
committerChip Salzenberg <chip@atlantic.net>
Sat, 26 Apr 1997 12:00:00 +0000 (00:00 +1200)
 CORE PORTABILITY

Subject: Return to favoring memset(,0,) over bzero()
From: Chip Salzenberg <chip@perl.com>
Files: perl.h

 OTHER CORE CHANGES

Subject: Update sprintf: '%hn'; '%s',NULL; panic on frexp() failure
From: Chip Salzenberg <chip@perl.com>
Files: perl.h pod/perldiag.pod sv.c

Changes
patchlevel.h
perl.h
pod/perldiag.pod
pod/perltoc.pod
sv.c

diff --git a/Changes b/Changes
index ab86e21..2b91f84 100644 (file)
--- a/Changes
+++ b/Changes
@@ -46,6 +46,108 @@ And the Keepers of the Patch Pumpkin:
 
 
 -----------------
+Version 5.003_97j
+-----------------
+
+This patch should be _98, unless it's egregiously broken somehow.
+
+ CORE LANGUAGE CHANGES
+
+   (no changes)
+
+ CORE PORTABILITY
+
+  Title:  "Return to favoring memset(,0,) over bzero()"
+   From:  Chip Salzenberg
+  Files:  perl.h
+
+  Title:  "NetBSD hint update"
+   From:  matthew green <mrg@splode.eterna.com.au>
+ Msg-ID:  <199704251021.EAA22570@jhereg.perl.com>
+   Date:  Fri, 25 Apr 1997 20:18:02 +1000
+  Files:  hints/netbsd.sh
+
+  Title:  "HP-UX hint update"
+   From:  Chuck D. Phillips <cdp@hpescdp.fc.hp.com>
+ Msg-ID:  <199704280535.WAA22441@palrel1.hp.com>
+   Date:  Sun, 27 Apr 1997 23:35:07 -0600
+  Files:  hints/hpux.sh
+
+  Title:  "Win32 update (three patches)"
+   From:  Gurusamy Sarathy and Nick Ing-Simmons
+  Files:  win32/makedef.pl win32/perllib.c win32/win32.c
+
+ OTHER CORE CHANGES
+
+  Title:  "Update sprintf: '%hn'; '%s',NULL; panic on frexp() failure"
+   From:  Chip Salzenberg
+  Files:  perl.h pod/perldiag.pod sv.c
+
+  Title:  "Fix lingering '%S' in XS_VERSION_BOOTCHECK"
+   From:  Chip Salzenberg
+  Files:  XSUB.h
+
+  Title:  "Eliminate Alpha warnings"
+   From:  Hallvard B Furuseth and Chip Salzenberg
+  Files:  perlsdio.h pp_sys.c
+
+  Title:  "Fix typo in NeXT dynaloader"
+   From:  Chip Salzenberg
+  Files:  ext/DynaLoader/dl_next.xs
+
+  Title:  "Fix possible buffer overflow under VMS"
+   From:  Chip Salzenberg
+  Files:  taint.c
+
+ BUILD PROCESS
+
+   (no changes)
+
+ LIBRARY AND EXTENSIONS
+
+  Title:  "Refresh CGI.pm to 2.35"
+   From:  Lincoln Stein <lstein@genome.wi.mit.edu>
+  Files:  lib/CGI.pm
+
+  Title:  "Refresh DB_File to 1.13"
+   From:  Paul Marquess
+ Msg-ID:  <9704271413.AA08876@claudius.bfsec.bt.co.uk>
+   Date:  Sun, 27 Apr 1997 15:12:59 +0100 (BST)
+  Files:  ext/DB_File/DB_File.pm ext/DB_File/DB_File.xs
+
+  Title:  "SelfLoader: fix prototype pattern, rename intrusive lexical"
+   From:  Jesse Glick <jesse@ginger> and Chip Salzenberg
+  Files:  lib/SelfLoader.pm
+
+ TESTS
+
+   (no changes)
+
+ UTILITIES
+
+   (no changes)
+
+ DOCUMENTATION
+
+  Title:  "Split perlmod"
+   From:  Tom Christiansen
+ Msg-ID:  <199704260050.RAA02468@toy.perl.com>
+   Date:  Fri, 25 Apr 1997 20:50:09 -0400
+  Files:  MANIFEST pod/Makefile pod/buildtoc pod/perl.pod
+          pod/perldsc.pod pod/perlfaq3.pod pod/perlipc.pod
+          pod/perlmod.pod pod/perlmodlib.pod pod/perlobj.pod
+          pod/perltie.pod pod/roffitall
+
+  Title:  "Describe __PACKAGE__ in perldelta"
+   From:  Chip Salzenberg
+  Files:  pod/perldelta.pod
+
+  Title:  "Doc fix for close of pipe handle"
+   From:  Chip Salzenberg
+  Files:  pod/perlfunc.pod
+
+
+-----------------
 Version 5.003_97i
 -----------------
 
index 38de854..cdc7186 100644 (file)
@@ -38,7 +38,7 @@
  */
 static char    *local_patches[] = {
        NULL
-       ,"Dev97A-I - Nine development patches to 5.003_97"
+       ,"Dev97A-J - Ten development patches to 5.003_97"
        ,NULL
 };
 
diff --git a/perl.h b/perl.h
index ac87be0..77ffb53 100644 (file)
--- a/perl.h
+++ b/perl.h
 #endif /* HAS_MEMCMP && HAS_SANE_MEMCMP */
 
 #ifndef memzero
-#   ifdef HAS_BZERO
-#      define memzero(d,l) bzero(d,l)
+#   ifdef HAS_MEMSET
+#      define memzero(d,l) memset(d,0,l)
 #   else
-#      ifdef HAS_MEMSET
-#          define memzero(d,l) memset(d,0,l)
+#      ifdef HAS_BZERO
+#          define memzero(d,l) bzero(d,l)
 #      else
 #          define memzero(d,l) my_bzero(d,l)
 #      endif
@@ -1210,7 +1210,10 @@ char *strcpy(), *strcat();
 #   endif
            double exp _((double));
            double log _((double));
+           double log10 _((double));
            double sqrt _((double));
+           double frexp _((double,int*));
+           double ldexp _((double,int));
            double modf _((double,double*));
            double sin _((double));
            double cos _((double));
index 5ee141e..16fd451 100644 (file)
@@ -1249,6 +1249,11 @@ C<./Configure -S> and rebuild Perl.
 (F) The range specified in a character class had a minimum character
 greater than the maximum character.  See L<perlre>.
 
+=item Invalid conversion in %s: "%s"
+
+(F) Perl does not understand the given format conversion.
+See L<perlfunc/sprintf>.
+
 =item Invalid type in pack: '%s'
 
 (F) The given character is not a valid pack type.  See L<perlfunc/pack>.
@@ -1699,6 +1704,10 @@ it wasn't an eval context.
 
 (P) The internal do_trans() routine was called with invalid operational data.
 
+=item panic: frexp
+
+(P) The library function frexp() failed, making printf("%f") impossible.
+
 =item panic: goto
 
 (P) We popped the context stack to a context with the specified label,
index b699e7f..8000468 100644 (file)
@@ -924,6 +924,10 @@ CGI script to do bad things?
 
 =item Internal change: PerlIO abstraction interface
 
+=item New and changed builtin constants
+
+__PACKAGE__
+
 =item New and changed builtin variables
 
 $^E, $^H, $^M
@@ -1364,7 +1368,7 @@ $ARGV, @ARGV, @INC, %INC, $ENV{expr}, $SIG{expr}, $^M
 
 =item SEE ALSO
 
-=head2 perlmod - Perl modules (packages)
+=head2 perlmod - Perl modules (packages and symbol tables)
 
 =item DESCRIPTION
 
@@ -1382,7 +1386,11 @@ $ARGV, @ARGV, @INC, %INC, $ENV{expr}, $SIG{expr}, $^M
 
 =back
 
-=item NOTE
+=item SEE ALSO
+
+=head2 perlmodlib - constructing new Perl modules and finding existing ones
+
+=item DESCRIPTION
 
 =item THE PERL MODULE LIBRARY
 
@@ -1390,8 +1398,8 @@ $ARGV, @ARGV, @INC, %INC, $ENV{expr}, $SIG{expr}, $^M
 
 =item Pragmatic Modules
 
-blib, diagnostics, integer, less, lib, locale, ops, overload, sigtrap,
-strict, subs, vmsish, vars
+use autouse MODULE => qw(sub1 sub2 sub3), blib, diagnostics, integer, less,
+lib, locale, ops, overload, sigtrap, strict, subs, vmsish, vars
 
 =item Standard Modules
 
@@ -1470,6 +1478,8 @@ can then be reduced to a small
 
 =back
 
+=item NOTE
+
 =head2 perlform - Perl formats
 
 =item DESCRIPTION
@@ -2850,7 +2860,7 @@ clearcache ( COUNT ), clearallcache ( ), disablecache ( ), enablecache ( )
 
 =item ABSTRACT
 
-=item INSTALLATION:
+=item INSTALLATION
 
 =item DESCRIPTION
 
@@ -2896,7 +2906,7 @@ B<Parameters:>, 4, 5, 6..
 
 =back
 
-=item CREATING FORMS:
+=item CREATING FORMS
 
 =over
 
@@ -2986,7 +2996,7 @@ scripts, B<referer()>, B<auth_type ()>, B<server_name ()>, B<virtual_host
 ()>, B<server_software ()>, B<remote_user ()>, B<user_name ()>,
 B<request_method()>
 
-=item CREATING HTML ELEMENTS:
+=item CREATING HTML ELEMENTS
 
 =over
 
diff --git a/sv.c b/sv.c
index 45fb77f..d4bc47e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1121,7 +1121,7 @@ IV i;
     case SVt_PVFM:
     case SVt_PVIO:
        croak("Can't coerce %s to integer in %s", sv_reftype(sv,0),
-           op_name[op->op_type]);
+           op_desc[op->op_type]);
     }
     (void)SvIOK_only(sv);                      /* validate number */
     SvIVX(sv) = i;
@@ -4163,6 +4163,7 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
     char *patend;
     STRLEN origlen;
     I32 svix = 0;
+    static char nullstr[] = "(null)";
 
     /* no matter what, this is a string now */
     (void)SvPV_force(sv, origlen);
@@ -4173,8 +4174,10 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
     if (patlen == 2 && pat[0] == '%') {
        switch (pat[1]) {
        case 's':
-           if (args)
-               sv_catpv(sv, va_arg(*args, char*));
+           if (args) {
+               char *s = va_arg(*args, char*);
+               sv_catpv(sv, s ? s : nullstr);
+           }
            else if (svix < svmax)
                sv_catsv(sv, *svargs);
            return;
@@ -4340,7 +4343,12 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
        case 's':
            if (args) {
                eptr = va_arg(*args, char*);
-               elen = strlen(eptr);
+               if (eptr)
+                   elen = strlen(eptr);
+               else {
+                   eptr = nullstr;
+                   elen = sizeof nullstr - 1;
+               }
            }
            else if (svix < svmax)
                eptr = SvPVx(svargs[svix++], elen);
@@ -4498,8 +4506,8 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
                i = PERL_INT_MIN;
                (void)frexp(nv, &i);
                if (i == PERL_INT_MIN)
-                   need = 400; /* busted -- be safe */
-               else if (i > 0)
+                   die("panic: frexp");
+               if (i > 0)
                    need = BIT_DIGITS(i);
            }
            need += has_precis ? precis : 6; /* known default */
@@ -4555,8 +4563,12 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
        case 'n':
            i = SvCUR(sv) - origlen;
            if (args) {
-               int *ip = va_arg(*args, int*);
-               *ip = i;
+               switch (intsize) {
+               case 'h':       *(va_arg(*args, short*)) = i; break;
+               default:        *(va_arg(*args, int*)) = i; break;
+               case 'l':       *(va_arg(*args, long*)) = i; break;
+               case 'V':       *(va_arg(*args, IV*)) = i; break;
+               }
            }
            else if (svix < svmax)
                sv_setuv(svargs[svix++], (UV)i);
@@ -4566,7 +4578,19 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
 
        default:
       unknown:
-           /* output mangled stuff without comment */
+           if (!args && dowarn &&
+                 (op->op_type == OP_PRTF || op->op_type == OP_SPRINTF)) {
+               SV *msg = sv_newmortal();
+               sv_setpvf(msg, "Invalid conversion in %s: ",
+                         (op->op_type == OP_PRTF) ? "printf" : "sprintf");
+               if (c)
+                   sv_catpvf(msg, isPRINT(c) ? "\"%%%c\"" : "\"%%\\%03o\"",
+                             c & 0xFF);
+               else
+                   sv_catpv(msg, "end of string");
+               warn("%_", msg); /* yes, this is reentrant */
+           }
+           /* output mangled stuff */
            eptr = p;
            elen = q - p;
            break;