This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_formline: restruture FF_LINEGLOB
[perl5.git] / pp_ctl.c
index 2817c12..ccd1676 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -889,14 +889,16 @@ PP(pp_formline)
            {
                const bool oneline = fpc[-1] == FF_LINESNGL;
                const char *s = item = SvPV_const(sv, len);
+               const char *const send = s + len;
+               STRLEN to_copy = len;
+               const U8 *source = (const U8 *) s;
+               U8 *tmp = NULL;
+
                item_is_utf8 = DO_UTF8(sv);
                itemsize = len;
-               if (itemsize) {
-                   STRLEN to_copy = itemsize;
-                   const char *const send = s + len;
-                   const U8 *source = (const U8 *) s;
-                   U8 *tmp = NULL;
-
+               if (!itemsize)
+                   break;
+               {
                    gotsome = TRUE;
                    chophere = s + itemsize;
                    while (s < send) {