--- JSON-XS/XS.xs 2011/07/27 15:53:40 1.111 +++ JSON-XS/XS.xs 2011/08/11 17:06:53 1.112 @@ -1996,8 +1996,11 @@ if (!INCR_DONE (self)) { // as an optimisation, do not accumulate white space in the incr buffer - if (self->incr_mode == INCR_M_WS) - SvCUR_set (self->incr_text, 0); + if (self->incr_mode == INCR_M_WS && self->incr_pos) + { + self->incr_pos = 0; + SvCUR_set (self->incr_text, 0); + } break; }