This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_scan_heredoc(): add cosmetic braces
authorDavid Mitchell <davem@iabyn.com>
Mon, 25 Mar 2019 19:14:43 +0000 (19:14 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 25 Mar 2019 20:32:21 +0000 (20:32 +0000)
add braces round a single-statement 'if' clause which contains a while
loop and spans several lines.

Should be functionally equivalent, but less visually confusing.

toke.c

diff --git a/toke.c b/toke.c
index 9bed338..a71a1fb 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -10112,7 +10112,7 @@ S_scan_heredoc(pTHX_ char *s)
           entered.  But we need them set here. */
        shared->ls_bufptr  = s;
        shared->ls_linestr = PL_linestr;
-       if (PL_lex_inwhat)
+       if (PL_lex_inwhat) {
          /* Look for a newline.  If the current buffer does not have one,
             peek into the line buffer of the parent lexing scope, going
             up as many levels as necessary to find one with a newline
@@ -10144,6 +10144,7 @@ S_scan_heredoc(pTHX_ char *s)
                goto streaming;
            }
          }
+        }
        else {  /* eval or we've already hit EOF */
            s = (char*)memchr((void*)s, '\n', PL_bufend - s);
            if (!s)