This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
set SvUTF8 on vectors only if there are chars > 127; update copyright
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 6 Feb 2000 20:45:30 +0000 (20:45 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 6 Feb 2000 20:45:30 +0000 (20:45 +0000)
years (from Gisle Aas)

p4raw-id: //depot/perl@5009

41 files changed:
EXTERN.h
INTERN.h
README
av.c
av.h
cop.h
cv.h
deb.c
doio.c
doop.c
dump.c
form.h
gv.c
gv.h
handy.h
hv.c
hv.h
mg.c
mg.h
op.c
op.h
perl.c
perl.h
perlio.c
perly.y
pp.c
pp.h
pp_ctl.c
pp_hot.c
pp_sys.c
regcomp.c
regexec.c
run.c
scope.c
sv.c
sv.h
toke.c
utf8.c
utf8.h
util.c
util.h

index 7601838..897fae6 100644 (file)
--- a/EXTERN.h
+++ b/EXTERN.h
@@ -1,6 +1,6 @@
 /*    EXTERN.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index ee2959c..286cc46 100644 (file)
--- a/INTERN.h
+++ b/INTERN.h
@@ -1,6 +1,6 @@
 /*    INTERN.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/README b/README
index 7b294f2..0925b98 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 
                           Perl Kit, Version 5.0
 
-                      Copyright 1989-1999, Larry Wall
+                      Copyright 1989-2000, Larry Wall
                            All rights reserved.
 
     This program is free software; you can redistribute it and/or modify
diff --git a/av.c b/av.c
index 264fe23..511d4d3 100644 (file)
--- a/av.c
+++ b/av.c
@@ -1,6 +1,6 @@
 /*    av.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/av.h b/av.h
index b56917f..6b66bfd 100644 (file)
--- a/av.h
+++ b/av.h
@@ -1,6 +1,6 @@
 /*    av.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/cop.h b/cop.h
index 5760a8d..734d2ea 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -1,6 +1,6 @@
 /*    cop.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/cv.h b/cv.h
index 8210298..adb424e 100644 (file)
--- a/cv.h
+++ b/cv.h
@@ -1,6 +1,6 @@
 /*    cv.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/deb.c b/deb.c
index 36b8ca3..0928c01 100644 (file)
--- a/deb.c
+++ b/deb.c
@@ -1,6 +1,6 @@
 /*    deb.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/doio.c b/doio.c
index 0463af8..cb5f3e2 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1,6 +1,6 @@
 /*    doio.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/doop.c b/doop.c
index 26ac87d..a0fa729 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -1,6 +1,6 @@
 /*    doop.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/dump.c b/dump.c
index e3648ea..569dc8c 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1,6 +1,6 @@
 /*    dump.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -131,9 +131,9 @@ Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
         }
        else {
            if (cur && isDIGIT(*(pv+1)))
-               Perl_sv_catpvf(aTHX_ sv, "\\%03o", *pv);
+               Perl_sv_catpvf(aTHX_ sv, "\\%03o", (U8)*pv);
            else
-               Perl_sv_catpvf(aTHX_ sv, "\\%o", *pv);
+               Perl_sv_catpvf(aTHX_ sv, "\\%o", (U8)*pv);
         }
     }
     sv_catpvn(sv, "\"", 1);
@@ -846,6 +846,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
     default:
        if (SvEVALED(sv))       sv_catpv(d, "EVALED,");
        if (SvIsUV(sv))         sv_catpv(d, "IsUV,");
+       if (SvUTF8(sv))         sv_catpv(d, "UTF8");
        break;
     case SVt_PVBM:
        if (SvTAIL(sv))         sv_catpv(d, "TAIL,");
diff --git a/form.h b/form.h
index 0d3053d..ca2a0c8 100644 (file)
--- a/form.h
+++ b/form.h
@@ -1,6 +1,6 @@
 /*    form.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/gv.c b/gv.c
index b8fef0d..a7ed085 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1,6 +1,6 @@
 /*    gv.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/gv.h b/gv.h
index 680f2c0..d2234a6 100644 (file)
--- a/gv.h
+++ b/gv.h
@@ -1,6 +1,6 @@
 /*    gv.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/handy.h b/handy.h
index 741c716..ce2631f 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -1,6 +1,6 @@
 /*    handy.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/hv.c b/hv.c
index e48e8b0..e3f3d95 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1,6 +1,6 @@
 /*    hv.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/hv.h b/hv.h
index f052258..5bc38a0 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -1,6 +1,6 @@
 /*    hv.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/mg.c b/mg.c
index 8d2e4e3..893f4ff 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1,6 +1,6 @@
 /*    mg.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/mg.h b/mg.h
index 6a8afdc..baedde5 100644 (file)
--- a/mg.h
+++ b/mg.h
@@ -1,6 +1,6 @@
 /*    mg.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/op.c b/op.c
index fb696a7..8f3330c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1,6 +1,6 @@
 /*    op.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/op.h b/op.h
index 2360f9b..6019486 100644 (file)
--- a/op.h
+++ b/op.h
@@ -1,6 +1,6 @@
 /*    op.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/perl.c b/perl.c
index 186b85c..40ce5ca 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1,6 +1,6 @@
 /*    perl.c
  *
- *    Copyright (c) 1987-1999 Larry Wall
+ *    Copyright (c) 1987-2000 Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -2036,7 +2036,7 @@ Perl_moreswitches(pTHX_ char *s)
                (int)LOCAL_PATCH_COUNT, (LOCAL_PATCH_COUNT!=1) ? "es" : "");
 #endif
 
-       printf("\n\nCopyright 1987-1999, Larry Wall\n");
+       printf("\n\nCopyright 1987-2000, Larry Wall\n");
 #ifdef MSDOS
        printf("\nMS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n");
 #endif
diff --git a/perl.h b/perl.h
index 37ef3f1..ebc0dba 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1,6 +1,6 @@
 /*    perl.h
  *
- *    Copyright (c) 1987-1997, Larry Wall
+ *    Copyright (c) 1987-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index 2ad8b4e..6945a75 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -1,6 +1,6 @@
 /*    perlio.c
  *
- *    Copyright (c) 1996-1999, Nick Ing-Simmons
+ *    Copyright (c) 1996-2000, Nick Ing-Simmons
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/perly.y b/perly.y
index e6ee287..5170b36 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -1,6 +1,6 @@
 /*    perly.y
  *
- *    Copyright (c) 1991-1997, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/pp.c b/pp.c
index aec5073..9406a0b 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1,6 +1,6 @@
 /*    pp.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/pp.h b/pp.h
index 49155c3..bdc0b1a 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -1,6 +1,6 @@
 /*    pp.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index 8eb02b7..972c21d 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1,6 +1,6 @@
 /*    pp_ctl.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -2865,7 +2865,7 @@ PP(pp_require)
     sv = POPs;
     if (SvNIOKp(sv)) {
        UV rev, ver, sver;
-       if (SvPOKp(sv) && SvUTF8(sv)) {         /* require v5.6.1 */
+       if (SvPOKp(sv)) {               /* require v5.6.1 */
            I32 len;
            U8 *s = (U8*)SvPVX(sv);
            U8 *end = (U8*)SvPVX(sv) + SvCUR(sv);
index 133265a..6ef302c 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1,6 +1,6 @@
 /*    pp_hot.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index 756ab10..a9292a1 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1,6 +1,6 @@
 /*    pp_sys.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
index bf08761..5df82c0 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -69,7 +69,7 @@
  *
  ****    Alterations to Henry's code are...
  ****
- ****    Copyright (c) 1991-1999, Larry Wall
+ ****    Copyright (c) 1991-2000, Larry Wall
  ****
  ****    You may distribute under the terms of either the GNU General Public
  ****    License or the Artistic License, as specified in the README file.
index 106c5d1..524313d 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -66,7 +66,7 @@
  *
  ****    Alterations to Henry's code are...
  ****
- ****    Copyright (c) 1991-1999, Larry Wall
+ ****    Copyright (c) 1991-2000, Larry Wall
  ****
  ****    You may distribute under the terms of either the GNU General Public
  ****    License or the Artistic License, as specified in the README file.
diff --git a/run.c b/run.c
index 2491b93..57f90de 100644 (file)
--- a/run.c
+++ b/run.c
@@ -1,6 +1,6 @@
 /*    run.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/scope.c b/scope.c
index 91e0374..0f56854 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,6 +1,6 @@
 /*    scope.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/sv.c b/sv.c
index 586c0dd..0cf3b4c 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1,6 +1,6 @@
 /*    sv.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/sv.h b/sv.h
index d8cd487..e583204 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1,6 +1,6 @@
 /*    sv.h
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/toke.c b/toke.c
index b9a12c4..3410ab5 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1,6 +1,6 @@
 /*    toke.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -6890,6 +6890,7 @@ Perl_scan_num(pTHX_ char *start)
                U8 tmpbuf[10];
                U8 *tmpend;
                NV nshift = 1.0;
+               bool utf8 = FALSE;
                s++;                            /* get past 'v' */
 
                sv = NEWSV(92,5);
@@ -6904,7 +6905,14 @@ Perl_scan_num(pTHX_ char *start)
                    while (isDIGIT(*pos))
                        pos++;
 
-                   tmpend = uv_to_utf8(tmpbuf, rev);
+                   if (rev > 127) {
+                       tmpend = uv_to_utf8(tmpbuf, rev);
+                       utf8 = TRUE;
+                   }
+                   else {
+                       tmpbuf[0] = (U8)rev;
+                       tmpend = &tmpbuf[1];
+                   }
                    *tmpend = '\0';
                    sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
                    if (rev > 0)
@@ -6917,6 +6925,7 @@ Perl_scan_num(pTHX_ char *start)
                rev = atoi(s);
                s = pos;
                tmpend = uv_to_utf8(tmpbuf, rev);
+               utf8 = utf8 || rev > 127;
                *tmpend = '\0';
                sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
                if (rev > 0)
@@ -6925,7 +6934,8 @@ Perl_scan_num(pTHX_ char *start)
                SvPOK_on(sv);
                SvNOK_on(sv);
                SvREADONLY_on(sv);
-               SvUTF8_on(sv);
+               if (utf8)
+                   SvUTF8_on(sv);
            }
        }
        break;
diff --git a/utf8.c b/utf8.c
index 0153fd6..3d9caf9 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1,6 +1,6 @@
 /*    utf8.c
  *
- *    Copyright (c) 1998-1999, Larry Wall
+ *    Copyright (c) 1998-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/utf8.h b/utf8.h
index 96ae621..e864316 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -1,6 +1,6 @@
 /*    utf8.h
  *
- *    Copyright (c) 1998-1999, Larry Wall
+ *    Copyright (c) 1998-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/util.c b/util.c
index d58b230..031922a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,6 +1,6 @@
 /*    util.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
diff --git a/util.h b/util.h
index 1c2c555..beb5215 100644 (file)
--- a/util.h
+++ b/util.h
@@ -1,6 +1,6 @@
 /*    util.h
  *
- *    Copyright (c) 1991-1997, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.