diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-23 22:19:34 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-23 22:19:34 +0000 |
commit | 8eb28a70b2ec19f2782a68fd1ccf1a9a24131140 (patch) | |
tree | b40b94c2d1463ffec28bfe7922341a83d6489d19 /pp.c | |
parent | 944630198f0165148571b6785f76ff7d16cad1a8 (diff) | |
download | perl-8eb28a70b2ec19f2782a68fd1ccf1a9a24131140.tar.gz |
Negation and Unicode: sort of solves 20010303.010,
except not quite like reported in the Subject
(Perl_warner is still utf8-ignorant).
p4raw-id: //depot/perl@12614
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -2157,15 +2157,22 @@ PP(pp_negate) sv_setsv(TARG, sv); *SvPV_force(TARG, len) = *s == '-' ? '+' : '-'; } - else if (DO_UTF8(sv) && UTF8_IS_START(*s) && isIDFIRST_utf8((U8*)s)) { - sv_setpvn(TARG, "-", 1); - sv_catsv(TARG, sv); + else if (DO_UTF8(sv)) { + SvIV_please(sv); + if (SvIOK(sv)) + goto oops_its_an_int; + if (SvNOK(sv)) + sv_setnv(TARG, -SvNV(sv)); + else { + sv_setpvn(TARG, "-", 1); + sv_catsv(TARG, sv); + } } else { - SvIV_please(sv); - if (SvIOK(sv)) - goto oops_its_an_int; - sv_setnv(TARG, -SvNV(sv)); + SvIV_please(sv); + if (SvIOK(sv)) + goto oops_its_an_int; + sv_setnv(TARG, -SvNV(sv)); } SETTARG; } |