… | |
… | |
1520 | { |
1520 | { |
1521 | dec_t dec; |
1521 | dec_t dec; |
1522 | SV *sv; |
1522 | SV *sv; |
1523 | |
1523 | |
1524 | /* work around bugs in 5.10 where manipulating magic values |
1524 | /* work around bugs in 5.10 where manipulating magic values |
1525 | * will perl ignore the magic in subsequent accesses |
1525 | * will perl ignore the magic in subsequent accesses. |
|
|
1526 | * also make a copy of non-PV values, to get them into a clean |
|
|
1527 | * state (SvPV should do that, but it's buggy, see below). |
1526 | */ |
1528 | */ |
1527 | /*SvGETMAGIC (string);*/ |
1529 | /*SvGETMAGIC (string);*/ |
1528 | if (SvMAGICAL (string)) |
1530 | if (SvMAGICAL (string) || !SvPOK (string)) |
1529 | string = sv_2mortal (newSVsv (string)); |
1531 | string = sv_2mortal (newSVsv (string)); |
1530 | |
1532 | |
1531 | SvUPGRADE (string, SVt_PV); |
1533 | SvUPGRADE (string, SVt_PV); |
1532 | |
1534 | |
1533 | /* work around a bug in perl 5.10, which causes SvCUR to fail an |
1535 | /* work around a bug in perl 5.10, which causes SvCUR to fail an |