add some code comments for the users of delimcpy()
authorDavid Mitchell <[email protected]>
Fri, 26 Aug 2016 11:10:58 +0000 (12:10 +0100)
committerDavid Mitchell <[email protected]>
Wed, 7 Sep 2016 20:00:16 +0000 (21:00 +0100)
While fixing delimcpy(), I found that it wasn't always clear what its
callers did, so I've added some extra code comments.

also add a balancing '}' in a comment block to help editors that
jump between matching brackets.

mg.c
toke.c

index 85e3175..863b5fc 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1208,6 +1208,8 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
        if (s && klen == 4 && strEQ(key,"PATH")) {
            const char * const strend = s + len;
 
+            /* set MGf_TAINTEDDIR if any component of the new path is
+             * relative or world-writeable */
            while (s < strend) {
                char tmpbuf[256];
                Stat_t st;
diff --git a/toke.c b/toke.c
index bd3280c..c56b632 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9648,7 +9648,9 @@ S_scan_heredoc(pTHX_ char *s)
               might think.  Odd syntax errors like s;@{<<; can gobble up
               the implicit semicolon at the end of a flie, causing the
               file handle to be closed even when we are not in a string
-              eval.  So shared may be null in that case.  */
+              eval.  So shared may be null in that case.
+               (Closing '}' here to balance the earlier open brace for
+               editors that look for matched pairs.) */
            if (UNLIKELY(!shared))
                goto interminable;
            /* A LEXSHARED struct with a null ls_prev pointer is the outer-
@@ -9809,8 +9811,8 @@ S_scan_heredoc(pTHX_ char *s)
 }
 
 /* scan_inputsymbol
-   takes: current position in input buffer
-   returns: new position in input buffer
+   takes: position of first '<' in input buffer
+   returns: position of first char following the last '>' in input buffer
    side-effects: pl_yylval and lex_op are set.
 
    This code handles: