summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorTAKAI Kousuke <62541129+t-a-k@users.noreply.github.com>2020-10-23 02:14:57 +0900
committerKarl Williamson <khw@cpan.org>2020-12-07 21:52:14 -0700
commitc279f3d0680f86f0de539f6491362e428af4fbd0 (patch)
tree822091ad0aa684560cc217748730f38b49725afc /pp.c
parentb15e443511c11c1f196c5a5ca57b89feed452a07 (diff)
downloadperl-c279f3d0680f86f0de539f6491362e428af4fbd0.tar.gz
pp.c: oct() now skips "0o" and "o" prefix.
t/op/oct.t: Add test for oct() with 0o and o prefix.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 5b5e163011..5e1706346d 100644
--- a/pp.c
+++ b/pp.c
@@ -3099,8 +3099,12 @@ PP(pp_oct)
flags |= PERL_SCAN_DISALLOW_PREFIX;
result_uv = grok_bin (tmps, &len, &flags, &result_nv);
}
- else
+ else {
+ if (isALPHA_FOLD_EQ(*tmps, 'o')) {
+ tmps++, len--;
+ }
result_uv = grok_oct (tmps, &len, &flags, &result_nv);
+ }
if (flags & PERL_SCAN_GREATER_THAN_UV_MAX) {
SETn(result_nv);