From: Larry Wall Date: Thu, 8 Feb 1996 20:31:04 +0000 (-0800) Subject: Re: Beta3: Fix for SEGV on deep nesting X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a38d6535f8637d53561bc3663eb96f6c054d0bbb;p=p5sagit%2Fp5-mst-13.2.git Re: Beta3: Fix for SEGV on deep nesting Change message to 'gamma'. Here's a "gamma safe" patch. --- diff --git a/perl.c b/perl.c index 360f9a0..738c95c 100644 --- a/perl.c +++ b/perl.c @@ -1152,7 +1152,7 @@ char *s; s++; return s; case 'v': - printf("\nThis is perl, version %s beta3",patchlevel); + printf("\nThis is perl, version %s gamma",patchlevel); #if defined(DEBUGGING) || defined(EMBED) || defined(MULTIPLICITY) fputs(" with", stdout); @@ -1271,6 +1271,15 @@ SV *sv; char *xfailed = Nullch; register char *s; I32 len; + int retval; +#if defined(DOSISH) && !defined(OS2) && !defined(atarist) +#define SEARCH_EXTS ".bat", ".cmd", NULL +#endif + /* additional extensions to try in each dir if scriptname not found */ +#ifdef SEARCH_EXTS + char *ext[] = { SEARCH_EXTS }; + int extidx = (strchr(scriptname,'.')) ? -1 : 0; /* has ext already */ +#endif #ifdef VMS if (dosearch && !strpbrk(scriptname,":[ 0) /* reset after previous loop */ + extidx = 0; + do { +#endif + DEBUG_p(fprintf(stderr,"Looking for %s\n",tokenbuf)); + retval = Stat(tokenbuf,&statbuf); +#ifdef SEARCH_EXTS + } while ( retval < 0 /* not there */ + && extidx>=0 && ext[extidx] /* try an extension? */ + && strcpy(tokenbuf+len, ext[extidx++]) + ); +#endif + if (retval < 0) continue; if (S_ISREG(statbuf.st_mode) && cando(S_IRUSR,TRUE,&statbuf) && cando(S_IXUSR,TRUE,&statbuf)) { @@ -1722,7 +1745,7 @@ init_stacks() retstack_ix = 0; retstack_max = 16; - New(50,cxstack,128,CONTEXT); + New(50,cxstack,129,CONTEXT); /* XXX should fix CXINC macro */ cxstack_ix = -1; cxstack_max = 128; diff --git a/scope.c b/scope.c index 79740dc..3f48609 100644 --- a/scope.c +++ b/scope.c @@ -30,7 +30,7 @@ I32 cxinc() { cxstack_max = cxstack_max * 3 / 2; - Renew(cxstack, cxstack_max, CONTEXT); + Renew(cxstack, cxstack_max + 1, CONTEXT); /* XXX should fix CXINC macro */ return cxstack_ix + 1; }