diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-12-27 08:09:15 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-12-27 08:09:15 +0000 |
commit | 20cf1f79230fba6e0a6ba5053785e5fc841ee053 (patch) | |
tree | 7330536f9f84dce0512bdb4bf4fa34e36a2e756b /pp.c | |
parent | 84cad487577c98362c0e1ea18600d4ea266a4cb4 (diff) | |
download | perl-20cf1f79230fba6e0a6ba5053785e5fc841ee053.tar.gz |
Refactor pp_chomp to process arguments in the same order as pp_chop.
Previously list chomp worked from last to first, whilst list chop worked from
first to last.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -818,12 +818,13 @@ PP(pp_schomp) PP(pp_chomp) { - dVAR; dSP; dMARK; dTARGET; + dVAR; dSP; dMARK; dTARGET; dORIGMARK; register I32 count = 0; - while (SP > MARK) - count += do_chomp(POPs); - XPUSHi(count); + while (MARK < SP) + count += do_chomp(*++MARK); + SP = ORIGMARK; + XPUSHTARG; RETURN; } |