emit more accurate diagnostic for syntax errors involving <>
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 6 May 1999 05:14:35 +0000 (05:14 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 6 May 1999 05:14:35 +0000 (05:14 +0000)
within eval""

p4raw-id: //depot/perl@3310

toke.c
utils/perldoc.PL

diff --git a/toke.c b/toke.c
index b4a3d1d..e776485 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -5669,19 +5669,23 @@ scan_inputsymbol(char *start)
     register char *s = start;          /* current position in buffer */
     register char *d;
     register char *e;
+    char *end;
     I32 len;
 
     d = PL_tokenbuf;                   /* start of temp holding space */
     e = PL_tokenbuf + sizeof PL_tokenbuf;      /* end of temp holding space */
-    s = delimcpy(d, e, s + 1, PL_bufend, '>', &len);   /* extract until > */
+    end = strchr(s, '\n');
+    if (!end)
+       end = PL_bufend;
+    s = delimcpy(d, e, s + 1, end, '>', &len); /* extract until > */
 
     /* die if we didn't have space for the contents of the <>,
-       or if it didn't end
+       or if it didn't end, or if we see a newline
     */
 
     if (len >= sizeof PL_tokenbuf)
        croak("Excessively long <> operator");
-    if (s >= PL_bufend)
+    if (s >= end)
        croak("Unterminated <> operator");
 
     s++;
index d4090c8..c351fbf 100644 (file)
@@ -611,7 +611,7 @@ contain fully qualified filenames, one per line.
 
 The item you want to look up.  Nested modules (such as C<File::Basename>)
 are specified either as C<File::Basename> or C<File/Basename>.  You may also
-give a descriptive name of a page, such as C<perlfunc>. You make also give a
+give a descriptive name of a page, such as C<perlfunc>. You may also give a
 partial or wrong-case name, such as "basename" for "File::Basename", but
 this will be slower, if there is more then one page with the same partial
 name, you will only get the first one.