From: Gurusamy Sarathy Date: Thu, 6 May 1999 05:14:35 +0000 (+0000) Subject: emit more accurate diagnostic for syntax errors involving <> X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b42086758bcb696abd56f37b9db1cd28e91236e;p=p5sagit%2Fp5-mst-13.2.git emit more accurate diagnostic for syntax errors involving <> within eval"" p4raw-id: //depot/perl@3310 --- diff --git a/toke.c b/toke.c index b4a3d1d..e776485 100644 --- 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++; diff --git a/utils/perldoc.PL b/utils/perldoc.PL index d4090c8..c351fbf 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -611,7 +611,7 @@ contain fully qualified filenames, one per line. The item you want to look up. Nested modules (such as C) are specified either as C or C. You may also -give a descriptive name of a page, such as C. You make also give a +give a descriptive name of a page, such as C. 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.