[ 26781]
Gisle notes that SvRTRIM should also write a new '\0' at the end.
p4raw-link: @26781 on //depot/perl:
bb4058bb936dbf9d1160c9511e5977b96d967664
p4raw-id: //depot/maint-5.8/perl@26830
p4raw-edited: from //depot/perl@26781 'edit in' mg.c (@26779..)
#define SvRTRIM(sv) STMT_START { \
STRLEN len = SvCUR(sv); \
- while (len > 0 && isSPACE(SvPVX(sv)[len-1])) \
+ char * const p = SvPVX(sv); \
+ while (len > 0 && isSPACE(p[len-1])) \
--len; \
SvCUR_set(sv, len); \
+ p[len] = '\0'; \
} STMT_END
int