summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-05-27 13:35:25 +0100
committerDavid Mitchell <davem@iabyn.com>2011-05-29 20:21:52 +0100
commit11f9eeafe5cba9d9e0c7aa0e94a6605fdc34b971 (patch)
tree3df9a0fcfb013a22120849638bbe5ad81c462346
parentb57b17349edad3eb77b8bbcdf1aee88b481e183f (diff)
downloadperl-11f9eeafe5cba9d9e0c7aa0e94a6605fdc34b971.tar.gz
pp_formline: combine two similar code chunks
FF_BLANK and FF_END do almost identical tidying up before returning
-rw-r--r--pp_ctl.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 79b7d32caa..2817c12bb2 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1018,14 +1018,8 @@ PP(pp_formline)
arg = *fpc++;
if (gotsome) {
if (arg) { /* repeat until fields exhausted? */
- *t = '\0';
- SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget));
- lines += FmLINES(PL_formtarget);
- if (targ_is_utf8)
- SvUTF8_on(PL_formtarget);
- FmLINES(PL_formtarget) = lines;
- SP = ORIGMARK;
- RETURNOP(cLISTOP->op_first);
+ fpc--;
+ goto end;
}
}
else {
@@ -1062,13 +1056,17 @@ PP(pp_formline)
break;
}
case FF_END:
+ end:
*t = '\0';
SvCUR_set(PL_formtarget, t - SvPVX_const(PL_formtarget));
if (targ_is_utf8)
SvUTF8_on(PL_formtarget);
FmLINES(PL_formtarget) += lines;
SP = ORIGMARK;
- RETPUSHYES;
+ if (fpc[-1] == FF_BLANK)
+ RETURNOP(cLISTOP->op_first);
+ else
+ RETPUSHYES;
}
}
}