From: Gurusamy Sarathy Date: Sun, 6 Dec 1998 13:35:31 +0000 (+0000) Subject: fix outdated/incorrect info about arbitrary limits X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f31cffe78d3a5cfa348eb1c3208e5daec5777d9;p=p5sagit%2Fp5-mst-13.2.git fix outdated/incorrect info about arbitrary limits p4raw-id: //depot/perl@2454 --- diff --git a/Changes b/Changes index be8b3d2..23464f9 100644 --- a/Changes +++ b/Changes @@ -20,7 +20,6 @@ current addresses (as of July 1998): Abigail Kenneth Albanowski Russ Allbery - Graham Barr Spider Boardman Tom Christiansen Jan Dubois @@ -51,10 +50,11 @@ current addresses (as of July 1998): And the Keepers of the Patch Pumpkin: Charles Bailey + Graham Barr Malcolm Beattie Tim Bunce Andy Dougherty - Gurusamy Sarathy + Gurusamy Sarathy Chip Salzenberg And, of course, the Author of Perl: diff --git a/perl.h b/perl.h index 0f8a94c..9560567 100644 --- a/perl.h +++ b/perl.h @@ -1349,6 +1349,15 @@ typedef I32 (*filter_t) _((int, SV *, int)); # endif #endif +/* XXX MAXPATHLEN should be determined by Configure */ +#ifndef MAXPATHLEN +# ifdef PATH_MAX +# define MAXPATHLEN PATH_MAX +# else +# define MAXPATHLEN 1024 +# endif +#endif + #ifndef FUNC_NAME_TO_PTR #define FUNC_NAME_TO_PTR(name) name #endif diff --git a/pod/perl.pod b/pod/perl.pod index 0d2251e..8bc94fa 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -119,9 +119,9 @@ BASIC-PLUS.) Expression syntax corresponds quite closely to C expression syntax. Unlike most Unix utilities, Perl does not arbitrarily limit the size of your data--if you've got the memory, Perl can slurp in your whole file as a single string. Recursion is of -unlimited depth. And the tables used by hashes (previously called +unlimited depth. And the tables used by hashes (sometimes called "associative arrays") grow as necessary to prevent degraded -performance. Perl uses sophisticated pattern matching techniques to +performance. Perl can use sophisticated pattern matching techniques to scan large amounts of data very quickly. Although optimized for scanning text, Perl can also deal with binary data, and can make dbm files look like hashes. Setuid Perl scripts are safer than C programs @@ -298,9 +298,7 @@ and syswrite().) While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a -given variable name may not be longer than 255 characters, and no -component of your PATH may be longer than 255 if you use B<-S>. A regular -expression may not compile to more than 32767 bytes internally. +given variable name may not be longer than 251 characters. You may mail your bug reports (be sure to include full configuration information as output by the myconfig program in the perl source tree, diff --git a/pod/perl5005delta.pod b/pod/perl5005delta.pod index 23bf0f3..205c6af 100644 --- a/pod/perl5005delta.pod +++ b/pod/perl5005delta.pod @@ -884,6 +884,14 @@ a B<-e> switch. Maybe your /tmp partition is full, or clobbered. (F) The create routine failed for some reason while trying to process a B<-e> switch. Maybe your /tmp partition is full, or clobbered. +=item regexp too big + +(F) The current implementation of regular expressions uses shorts as +address offsets within a string. Unfortunately this means that if +the regular expression compiles to longer than 32767, it'll blow up. +Usually when you want a regular expression this big, there is a better +way to do it with multiple statements. See L. + =back =head1 BUGS diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 29ed897..6b4c127 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2241,14 +2241,6 @@ expression compiler gave it. (P) A "can't happen" error, because safemalloc() should have caught it earlier. -=item regexp too big - -(F) The current implementation of regular expressions uses shorts as -address offsets within a string. Unfortunately this means that if -the regular expression compiles to longer than 32767, it'll blow up. -Usually when you want a regular expression this big, there is a better -way to do it with multiple statements. See L. - =item Reversed %s= operator (W) You wrote your assignment operator backwards. The = must always diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 557d418..702d8bf 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -15,7 +15,7 @@ operator. A unary operator generally provides a scalar context to its argument, while a list operator may provide either scalar and list contexts for its arguments. If it does both, the scalar arguments will be first, and the list argument will follow. (Note that there can ever -be only one list argument.) For instance, splice() has three scalar +be only one such list argument.) For instance, splice() has three scalar arguments followed by a list. In the syntax descriptions that follow, list operators that expect a @@ -1473,7 +1473,7 @@ L, L, and L for additional control flow. Enter BLOCK as LOOPVAR set in turn to each element of LIST. For example: - foreach $rolling (@stones) { print "rolling $stone\n" } + foreach $rolling (@stones) { print "$rolling stone\n" } foreach my $file (@files) { print "file $file\n" } diff --git a/pp_sys.c b/pp_sys.c index 35d6f6f..d60c8dc 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -173,14 +173,6 @@ static int dooneliner _((char *cmd, char *filename)); #endif /* no flock() */ -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 1024 -# endif -#endif - #define ZBTLEN 10 static char zero_but_true[ZBTLEN + 1] = "0 but true"; diff --git a/util.c b/util.c index 1c5ea59..845ae4c 100644 --- a/util.c +++ b/util.c @@ -2459,7 +2459,7 @@ find_script(char *scriptname, bool dosearch, char **search_ext, I32 flags) dTHR; char *xfound = Nullch; char *xfailed = Nullch; - char tmpbuf[512]; + char tmpbuf[MAXPATHLEN]; register char *s; I32 len; int retval;