home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-13 | 46.9 KB | 1,932 lines |
- Newsgroups: comp.sources.misc
- From: lwall@netlabs.com (Larry Wall)
- Subject: v25i066: perl - The perl programming language, Patch17
- Message-ID: <1991Nov13.214600.3968@sparky.imd.sterling.com>
- X-Md4-Signature: 2ca4c293c1a20f9300b96dd274f08234
- Date: Wed, 13 Nov 1991 21:46:00 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: lwall@netlabs.com (Larry Wall)
- Posting-number: Volume 25, Issue 66
- Archive-name: perl/patch17
- Environment: UNIX, MS-DOS, OS2
- Patch-To: perl: Volume 18, Issue 19-54
-
- System: perl version 4.0
- Patch #: 17
- Priority: MED-HIGH
- Subject: patch #11, continued
-
- Description:
- See patch #11.
-
- Fix: From rn, say "| patch -p -N -d DIR", where DIR is your perl source
- directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
- If you don't have the patch program, apply the following by hand,
- or get patch (version 2.0, latest patchlevel).
-
- After patching:
- *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #18 FIRST ***
-
- If patch indicates that patchlevel is the wrong version, you may need
- to apply one or more previous patches, or the patch may already
- have been applied. See the patchlevel.h file to find out what has or
- has not been applied. In any event, don't continue with the patch.
-
- If you are missing previous patches they can be obtained from me:
-
- Larry Wall
- lwall@netlabs.com
-
- If you send a mail message of the following form it will greatly speed
- processing:
-
- Subject: Command
- @SH mailpatch PATH perl 4.0 LIST
- ^ note the c
-
- where PATH is a return path FROM ME TO YOU either in Internet notation,
- or in bang notation from some well-known host, and LIST is the number
- of one or more patches you need, separated by spaces, commas, and/or
- hyphens. Saying 35- says everything from 35 to the end.
-
-
- Index: patchlevel.h
- Prereq: 16
- 1c1
- < #define PATCHLEVEL 16
- ---
- > #define PATCHLEVEL 17
-
- Index: str.h
- *** str.h.old Tue Nov 5 19:27:58 1991
- --- str.h Tue Nov 5 19:27:58 1991
- ***************
- *** 1,4 ****
- ! /* $RCSfile: str.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:33 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: str.h,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:41:47 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,15 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: str.h,v $
- + * Revision 4.0.1.3 91/11/05 18:41:47 lwall
- + * patch11: random cleanup
- + * patch11: solitary subroutine references no longer trigger typo warnings
- + *
- * Revision 4.0.1.2 91/06/07 11:58:33 lwall
- * patch4: new copyright notice
- *
- ***************
- *** 32,39 ****
- STRLEN str_cur; /* length of str_ptr as a C string */
- STR *str_magic; /* while free, link to next free str */
- /* while in use, ptr to "key" for magic items */
- ! char str_pok; /* state of str_ptr */
- ! char str_nok; /* state of str_nval */
- unsigned char str_rare; /* used by search strings */
- unsigned char str_state; /* one of SS_* below */
- /* also used by search strings for backoff */
- --- 36,43 ----
- STRLEN str_cur; /* length of str_ptr as a C string */
- STR *str_magic; /* while free, link to next free str */
- /* while in use, ptr to "key" for magic items */
- ! unsigned char str_pok; /* state of str_ptr */
- ! unsigned char str_nok; /* state of str_nval */
- unsigned char str_rare; /* used by search strings */
- unsigned char str_state; /* one of SS_* below */
- /* also used by search strings for backoff */
- ***************
- *** 57,64 ****
- STRLEN str_cur; /* length of str_ptr as a C string */
- STR *str_magic; /* while free, link to next free str */
- /* while in use, ptr to "key" for magic items */
- ! char str_pok; /* state of str_ptr */
- ! char str_nok; /* state of str_nval */
- unsigned char str_rare; /* used by search strings */
- unsigned char str_state; /* one of SS_* below */
- /* also used by search strings for backoff */
- --- 61,68 ----
- STRLEN str_cur; /* length of str_ptr as a C string */
- STR *str_magic; /* while free, link to next free str */
- /* while in use, ptr to "key" for magic items */
- ! unsigned char str_pok; /* state of str_ptr */
- ! unsigned char str_nok; /* state of str_nval */
- unsigned char str_rare; /* used by search strings */
- unsigned char str_state; /* one of SS_* below */
- /* also used by search strings for backoff */
- ***************
- *** 136,138 ****
- --- 140,144 ----
- void str_magic();
- void str_insert();
- STRLEN str_len();
- +
- + #define MULTI (3)
-
- Index: t/cmd/subval.t
- Prereq: 4.0
- *** t/cmd/subval.t.old Tue Nov 5 19:28:00 1991
- --- t/cmd/subval.t Tue Nov 5 19:28:00 1991
- ***************
- *** 1,6 ****
- #!./perl
-
- ! # $Header: subval.t,v 4.0 91/03/20 01:49:40 lwall Locked $
-
- sub foo1 {
- 'true1';
- --- 1,6 ----
- #!./perl
-
- ! # $RCSfile: subval.t,v $$Revision: 4.0.1.1 $$Date: 91/11/05 18:42:31 $
-
- sub foo1 {
- 'true1';
- ***************
- *** 102,108 ****
- sub somesub {
- local($num,$P,$F,$L) = @_;
- ($p,$f,$l) = caller;
- ! print "$p:$f:$l" eq "$P:$F:$L" ? "ok $num\n" : "not ok $num\n";
- }
-
- &somesub(27, 'main', __FILE__, __LINE__);
- --- 102,108 ----
- sub somesub {
- local($num,$P,$F,$L) = @_;
- ($p,$f,$l) = caller;
- ! print "$p:$f:$l" eq "$P:$F:$L" ? "ok $num\n" : "not ok $num $p:$f:$l ne $P:$F:$L\n";
- }
-
- &somesub(27, 'main', __FILE__, __LINE__);
-
- Index: hints/sunos_4_0_1.sh
- *** hints/sunos_4_0_1.sh.old Tue Nov 5 19:26:39 1991
- --- hints/sunos_4_0_1.sh Tue Nov 5 19:26:39 1991
- ***************
- *** 1 ****
- ! $ccflags="$ccflags -DFPUTS_BOTCH"
- --- 1 ----
- ! ccflags="$ccflags -DFPUTS_BOTCH"
-
- Index: hints/sunos_4_0_2.sh
- *** hints/sunos_4_0_2.sh.old Tue Nov 5 19:26:41 1991
- --- hints/sunos_4_0_2.sh Tue Nov 5 19:26:41 1991
- ***************
- *** 1 ****
- ! $ccflags="$ccflags -DFPUTS_BOTCH"
- --- 1 ----
- ! ccflags="$ccflags -DFPUTS_BOTCH"
-
- Index: hints/ti1500.sh
- *** hints/ti1500.sh.old Tue Nov 5 19:26:43 1991
- --- hints/ti1500.sh Tue Nov 5 19:26:43 1991
- ***************
- *** 0 ****
- --- 1 ----
- + d_mymalloc='undef'
-
- Index: toke.c
- *** toke.c.old Tue Nov 5 19:28:09 1991
- --- toke.c Tue Nov 5 19:28:10 1991
- ***************
- *** 1,4 ****
- ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.3 $$Date: 91/06/10 01:32:26 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.4 $$Date: 91/11/05 19:02:48 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,19 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: toke.c,v $
- + * Revision 4.0.1.4 91/11/05 19:02:48 lwall
- + * patch11: \x and \c were subject to double interpretation in regexps
- + * patch11: prepared for ctype implementations that don't define isascii()
- + * patch11: nested list operators could miscount parens
- + * patch11: once-thru blocks didn't display right in the debugger
- + * patch11: sort eval "whatever" didn't work
- + * patch11: underscore is now allowed within literal octal and hex numbers
- + *
- * Revision 4.0.1.3 91/06/10 01:32:26 lwall
- * patch10: m'$foo' now treats string as single quoted
- * patch10: certain pattern optimizations were botched
- ***************
- *** 41,47 ****
-
- /* which backslash sequences to keep in m// or s// */
-
- ! static char *patleave = "\\.^$@dDwWsSbB+*?|()-nrtf0123456789[{]}";
-
- char *reparse; /* if non-null, scanident found ${foo[$bar]} */
-
- --- 49,55 ----
-
- /* which backslash sequences to keep in m// or s// */
-
- ! static char *patleave = "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}";
-
- char *reparse; /* if non-null, scanident found ${foo[$bar]} */
-
- ***************
- *** 92,98 ****
- * paren came before the listop rather than after.
- */
- #define LOP(f) return(CLINE, *s == '(' || (s = skipspace(s), *s == '(') ? \
- ! (*s = META('('), bufptr = oldbufptr, '(') : \
- (yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP))
- /* grandfather return to old style */
- #define OLDLOP(f) return(yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP)
- --- 100,106 ----
- * paren came before the listop rather than after.
- */
- #define LOP(f) return(CLINE, *s == '(' || (s = skipspace(s), *s == '(') ? \
- ! (*s = (char) META('('), bufptr = oldbufptr, '(') : \
- (yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP))
- /* grandfather return to old style */
- #define OLDLOP(f) return(yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP)
- ***************
- *** 101,107 ****
- skipspace(s)
- register char *s;
- {
- ! while (s < bufend && isascii(*s) && isspace(*s))
- s++;
- return s;
- }
- --- 109,115 ----
- skipspace(s)
- register char *s;
- {
- ! while (s < bufend && isSPACE(*s))
- s++;
- return s;
- }
- ***************
- *** 175,182 ****
- #endif
- #ifdef BADSWITCH
- if (*s & 128) {
- ! if ((*s & 127) == '(')
- *s++ = '(';
- else
- warn("Unrecognized character \\%03o ignored", *s++ & 255);
- goto retry;
- --- 183,192 ----
- #endif
- #ifdef BADSWITCH
- if (*s & 128) {
- ! if ((*s & 127) == '(') {
- *s++ = '(';
- + oldbufptr = s;
- + }
- else
- warn("Unrecognized character \\%03o ignored", *s++ & 255);
- goto retry;
- ***************
- *** 184,191 ****
- #endif
- switch (*s) {
- default:
- ! if ((*s & 127) == '(')
- *s++ = '(';
- else
- warn("Unrecognized character \\%03o ignored", *s++ & 255);
- goto retry;
- --- 194,203 ----
- #endif
- switch (*s) {
- default:
- ! if ((*s & 127) == '(') {
- *s++ = '(';
- + oldbufptr = s;
- + }
- else
- warn("Unrecognized character \\%03o ignored", *s++ & 255);
- goto retry;
- ***************
- *** 238,244 ****
- if (rsfp) {
- if (preprocess)
- (void)mypclose(rsfp);
- ! else if (rsfp == stdin)
- clearerr(stdin);
- else
- (void)fclose(rsfp);
- --- 250,256 ----
- if (rsfp) {
- if (preprocess)
- (void)mypclose(rsfp);
- ! else if ((FILE*)rsfp == stdin)
- clearerr(stdin);
- else
- (void)fclose(rsfp);
- ***************
- *** 283,297 ****
- if (*s == ' ')
- s++;
- cmd = s;
- ! while (s < bufend && !isspace(*s))
- s++;
- *s++ = '\0';
- ! while (s < bufend && isspace(*s))
- s++;
- if (s < bufend) {
- Newz(899,newargv,origargc+3,char*);
- newargv[1] = s;
- ! while (s < bufend && !isspace(*s))
- s++;
- *s = '\0';
- Copy(origargv+1, newargv+2, origargc+1, char*);
- --- 295,309 ----
- if (*s == ' ')
- s++;
- cmd = s;
- ! while (s < bufend && !isSPACE(*s))
- s++;
- *s++ = '\0';
- ! while (s < bufend && isSPACE(*s))
- s++;
- if (s < bufend) {
- Newz(899,newargv,origargc+3,char*);
- newargv[1] = s;
- ! while (s < bufend && !isSPACE(*s))
- s++;
- *s = '\0';
- Copy(origargv+1, newargv+2, origargc+1, char*);
- ***************
- *** 304,310 ****
- }
- }
- else {
- ! while (s < bufend && isspace(*s))
- s++;
- if (*s == ':') /* for csh's that have to exec sh scripts */
- s++;
- --- 316,322 ----
- }
- }
- else {
- ! while (s < bufend && isSPACE(*s))
- s++;
- if (*s == ':') /* for csh's that have to exec sh scripts */
- s++;
- ***************
- *** 316,326 ****
- goto retry;
- case '#':
- if (preprocess && s == str_get(linestr) &&
- ! s[1] == ' ' && isdigit(s[2])) {
- ! curcmd->c_line = atoi(s+2)-1;
- ! for (s += 2; isdigit(*s); s++) ;
- d = bufend;
- ! while (s < d && isspace(*s)) s++;
- s[strlen(s)-1] = '\0'; /* wipe out newline */
- if (*s == '"') {
- s++;
- --- 328,341 ----
- goto retry;
- case '#':
- if (preprocess && s == str_get(linestr) &&
- ! s[1] == ' ' && (isDIGIT(s[2]) || strnEQ(s+2,"line ",5)) ) {
- ! while (*s && !isDIGIT(*s))
- ! s++;
- ! curcmd->c_line = atoi(s)-1;
- ! while (isDIGIT(*s))
- ! s++;
- d = bufend;
- ! while (s < d && isSPACE(*s)) s++;
- s[strlen(s)-1] = '\0'; /* wipe out newline */
- if (*s == '"') {
- s++;
- ***************
- *** 355,361 ****
- }
- goto retry;
- case '-':
- ! if (s[1] && isalpha(s[1]) && !isalpha(s[2])) {
- s++;
- switch (*s++) {
- case 'r': FTST(O_FTEREAD);
- --- 370,376 ----
- }
- goto retry;
- case '-':
- ! if (s[1] && isALPHA(s[1]) && !isALPHA(s[2])) {
- s++;
- switch (*s++) {
- case 'r': FTST(O_FTEREAD);
- ***************
- *** 441,447 ****
- OPERATOR(tmp);
- case '{':
- tmp = *s++;
- ! if (isspace(*s) || *s == '#')
- cmdline = NOLINE; /* invalidate current command line number */
- OPERATOR(tmp);
- case ';':
- --- 456,463 ----
- OPERATOR(tmp);
- case '{':
- tmp = *s++;
- ! yylval.ival = curcmd->c_line;
- ! if (isSPACE(*s) || *s == '#')
- cmdline = NOLINE; /* invalidate current command line number */
- OPERATOR(tmp);
- case ';':
- ***************
- *** 464,472 ****
- s--;
- if (expectterm) {
- d = bufend;
- ! while (s < d && isspace(*s))
- s++;
- ! if (isalpha(*s) || *s == '_' || *s == '\'')
- *(--s) = '\\'; /* force next ident to WORD */
- OPERATOR(AMPER);
- }
- --- 480,488 ----
- s--;
- if (expectterm) {
- d = bufend;
- ! while (s < d && isSPACE(*s))
- s++;
- ! if (isALPHA(*s) || *s == '_' || *s == '\'')
- *(--s) = '\\'; /* force next ident to WORD */
- OPERATOR(AMPER);
- }
- ***************
- *** 526,533 ****
-
- #define SNARFWORD \
- d = tokenbuf; \
- ! while (isascii(*s) && \
- ! (isalpha(*s) || isdigit(*s) || *s == '_' || *s == '\'')) \
- *d++ = *s++; \
- while (d[-1] == '\'') \
- d--,s--; \
- --- 542,548 ----
-
- #define SNARFWORD \
- d = tokenbuf; \
- ! while (isALNUM(*s) || *s == '\'') \
- *d++ = *s++; \
- while (d[-1] == '\'') \
- d--,s--; \
- ***************
- *** 535,541 ****
- d = tokenbuf;
-
- case '$':
- ! if (s[1] == '#' && (isalpha(s[2]) || s[2] == '_')) {
- s++;
- s = scanident(s,bufend,tokenbuf);
- yylval.stabval = aadd(stabent(tokenbuf,TRUE));
- --- 550,556 ----
- d = tokenbuf;
-
- case '$':
- ! if (s[1] == '#' && (isALPHA(s[2]) || s[2] == '_')) {
- s++;
- s = scanident(s,bufend,tokenbuf);
- yylval.stabval = aadd(stabent(tokenbuf,TRUE));
- ***************
- *** 574,580 ****
- OPERATOR(tmp);
-
- case '.':
- ! if (!expectterm || !isdigit(s[1])) {
- tmp = *s++;
- if (*s == tmp) {
- s++;
- --- 589,595 ----
- OPERATOR(tmp);
-
- case '.':
- ! if (!expectterm || !isDIGIT(s[1])) {
- tmp = *s++;
- if (*s == tmp) {
- s++;
- ***************
- *** 613,618 ****
- --- 628,634 ----
- STAB *stab;
- int fd;
-
- + /*SUPPRESS 560*/
- if (stab = stabent("DATA",FALSE)) {
- stab->str_pok |= SP_MULTI;
- stab_io(stab) = stio_new();
- ***************
- *** 623,629 ****
- #endif
- if (preprocess)
- stab_io(stab)->type = '|';
- ! else if (rsfp == stdin)
- stab_io(stab)->type = '-';
- else
- stab_io(stab)->type = '<';
- --- 639,645 ----
- #endif
- if (preprocess)
- stab_io(stab)->type = '|';
- ! else if ((FILE*)rsfp == stdin)
- stab_io(stab)->type = '-';
- else
- stab_io(stab)->type = '<';
- ***************
- *** 670,676 ****
- UNI(O_CALLER);
- if (strEQ(d,"crypt")) {
- #ifdef FCRYPT
- ! init_des();
- #endif
- FUN2(O_CRYPT);
- }
- --- 686,695 ----
- UNI(O_CALLER);
- if (strEQ(d,"crypt")) {
- #ifdef FCRYPT
- ! static int cryptseen = 0;
- !
- ! if (!cryptseen++)
- ! init_des();
- #endif
- FUN2(O_CRYPT);
- }
- ***************
- *** 689,697 ****
- SNARFWORD;
- if (strEQ(d,"do")) {
- d = bufend;
- ! while (s < d && isspace(*s))
- s++;
- ! if (isalpha(*s) || *s == '_')
- *(--s) = '\\'; /* force next ident to WORD */
- OPERATOR(DO);
- }
- --- 708,716 ----
- SNARFWORD;
- if (strEQ(d,"do")) {
- d = bufend;
- ! while (s < d && isSPACE(*s))
- s++;
- ! if (isALPHA(*s) || *s == '_')
- *(--s) = '\\'; /* force next ident to WORD */
- OPERATOR(DO);
- }
- ***************
- *** 755,763 ****
- }
- if (strEQ(d,"format")) {
- d = bufend;
- ! while (s < d && isspace(*s))
- s++;
- ! if (isalpha(*s) || *s == '_')
- *(--s) = '\\'; /* force next ident to WORD */
- in_format = TRUE;
- allstabs = TRUE; /* must initialize everything since */
- --- 774,782 ----
- }
- if (strEQ(d,"format")) {
- d = bufend;
- ! while (s < d && isSPACE(*s))
- s++;
- ! if (isALPHA(*s) || *s == '_')
- *(--s) = '\\'; /* force next ident to WORD */
- in_format = TRUE;
- allstabs = TRUE; /* must initialize everything since */
- ***************
- *** 1125,1135 ****
- if (strEQ(d,"sort")) {
- checkcomma(s,"subroutine name");
- d = bufend;
- ! while (s < d && isascii(*s) && isspace(*s)) s++;
- if (*s == ';' || *s == ')') /* probably a close */
- fatal("sort is now a reserved word");
- ! if (isascii(*s) && (isalpha(*s) || *s == '_')) {
- ! for (d = s; isalpha(*d) || isdigit(*d) || *d == '_'; d++) ;
- strncpy(tokenbuf,s,d-s);
- if (strNE(tokenbuf,"keys") &&
- strNE(tokenbuf,"values") &&
- --- 1144,1155 ----
- if (strEQ(d,"sort")) {
- checkcomma(s,"subroutine name");
- d = bufend;
- ! while (s < d && isSPACE(*s)) s++;
- if (*s == ';' || *s == ')') /* probably a close */
- fatal("sort is now a reserved word");
- ! if (isALPHA(*s) || *s == '_') {
- ! /*SUPPRESS 530*/
- ! for (d = s; isALNUM(*d); d++) ;
- strncpy(tokenbuf,s,d-s);
- if (strNE(tokenbuf,"keys") &&
- strNE(tokenbuf,"values") &&
- ***************
- *** 1138,1144 ****
- strNE(tokenbuf,"readdir") &&
- strNE(tokenbuf,"unpack") &&
- strNE(tokenbuf,"do") &&
- ! (d >= bufend || isspace(*d)) )
- *(--s) = '\\'; /* force next ident to WORD */
- }
- LOP(O_SORT);
- --- 1158,1165 ----
- strNE(tokenbuf,"readdir") &&
- strNE(tokenbuf,"unpack") &&
- strNE(tokenbuf,"do") &&
- ! strNE(tokenbuf,"eval") &&
- ! (d >= bufend || isSPACE(*d)) )
- *(--s) = '\\'; /* force next ident to WORD */
- }
- LOP(O_SORT);
- ***************
- *** 1176,1192 ****
- if (strEQ(d,"substr"))
- FUN2x(O_SUBSTR);
- if (strEQ(d,"sub")) {
- subline = curcmd->c_line;
- d = bufend;
- ! while (s < d && isspace(*s))
- s++;
- ! if (isalpha(*s) || *s == '_' || *s == '\'') {
- if (perldb) {
- str_sset(subname,curstname);
- str_ncat(subname,"'",1);
- ! for (d = s+1;
- ! isalpha(*d) || isdigit(*d) || *d == '_' || *d == '\'';
- ! d++);
- if (d[-1] == '\'')
- d--;
- str_ncat(subname,s,d-s);
- --- 1197,1219 ----
- if (strEQ(d,"substr"))
- FUN2x(O_SUBSTR);
- if (strEQ(d,"sub")) {
- + yylval.ival = savestack->ary_fill; /* restore stuff on reduce */
- + if (perldb) {
- + savelong(&subline);
- + saveitem(subname);
- + }
- +
- subline = curcmd->c_line;
- d = bufend;
- ! while (s < d && isSPACE(*s))
- s++;
- ! if (isALPHA(*s) || *s == '_' || *s == '\'') {
- if (perldb) {
- str_sset(subname,curstname);
- str_ncat(subname,"'",1);
- ! for (d = s+1; isALNUM(*d) || *d == '\''; d++)
- ! /*SUPPRESS 530*/
- ! ;
- if (d[-1] == '\'')
- d--;
- str_ncat(subname,s,d-s);
- ***************
- *** 1322,1328 ****
- yylval.cval = savestr(d);
- expectterm = FALSE;
- if (oldoldbufptr && oldoldbufptr < bufptr) {
- ! while (isspace(*oldoldbufptr))
- oldoldbufptr++;
- if (*oldoldbufptr == 'p' && strnEQ(oldoldbufptr,"print",5))
- expectterm = TRUE;
- --- 1349,1355 ----
- yylval.cval = savestr(d);
- expectterm = FALSE;
- if (oldoldbufptr && oldoldbufptr < bufptr) {
- ! while (isSPACE(*oldoldbufptr))
- oldoldbufptr++;
- if (*oldoldbufptr == 'p' && strnEQ(oldoldbufptr,"print",5))
- expectterm = TRUE;
- ***************
- *** 1341,1353 ****
-
- if (*s == '(')
- s++;
- ! while (s < bufend && isascii(*s) && isspace(*s))
- s++;
- ! if (isascii(*s) && (isalpha(*s) || *s == '_')) {
- someword = s++;
- ! while (isalpha(*s) || isdigit(*s) || *s == '_')
- s++;
- ! while (s < bufend && isspace(*s))
- s++;
- if (*s == ',') {
- *s = '\0';
- --- 1368,1380 ----
-
- if (*s == '(')
- s++;
- ! while (s < bufend && isSPACE(*s))
- s++;
- ! if (isALPHA(*s) || *s == '_') {
- someword = s++;
- ! while (isALNUM(*s))
- s++;
- ! while (s < bufend && isSPACE(*s))
- s++;
- if (*s == ',') {
- *s = '\0';
- ***************
- *** 1375,1386 ****
- reparse = Nullch;
- s++;
- d = dest;
- ! if (isdigit(*s)) {
- ! while (isdigit(*s))
- *d++ = *s++;
- }
- else {
- ! while (isalpha(*s) || isdigit(*s) || *s == '_' || *s == '\'')
- *d++ = *s++;
- }
- while (d > dest+1 && d[-1] == '\'')
- --- 1402,1413 ----
- reparse = Nullch;
- s++;
- d = dest;
- ! if (isDIGIT(*s)) {
- ! while (isDIGIT(*s))
- *d++ = *s++;
- }
- else {
- ! while (isALNUM(*s) || *s == '\'')
- *d++ = *s++;
- }
- while (d > dest+1 && d[-1] == '\'')
- ***************
- *** 1393,1400 ****
- d = dest;
- brackets++;
- while (s < send && brackets) {
- ! if (!reparse && (d == dest || (*s && isascii(*s) &&
- ! (isalpha(*s) || isdigit(*s) || *s == '_') ))) {
- *d++ = *s++;
- continue;
- }
- --- 1420,1426 ----
- d = dest;
- brackets++;
- while (s < send && brackets) {
- ! if (!reparse && (d == dest || (*s && isALNUM(*s) ))) {
- *d++ = *s++;
- continue;
- }
- ***************
- *** 1418,1435 ****
- else
- d[1] = '\0';
- }
- ! if (*d == '^' && (isupper(*s) || index("[\\]^_?",*s)))
- *d = *s++ ^ 64;
- return s;
- }
-
- ! STR *
- scanconst(spat,string,len)
- SPAT *spat;
- char *string;
- int len;
- {
- ! register STR *retstr;
- register char *t;
- register char *d;
- register char *e;
- --- 1444,1466 ----
- else
- d[1] = '\0';
- }
- ! if (*d == '^' && (isUPPER(*s) || index("[\\]^_?", *s))) {
- ! #ifdef DEBUGGING
- ! if (*s == 'D')
- ! debug |= 32768;
- ! #endif
- *d = *s++ ^ 64;
- + }
- return s;
- }
-
- ! void
- scanconst(spat,string,len)
- SPAT *spat;
- char *string;
- int len;
- {
- ! register STR *tmpstr;
- register char *t;
- register char *d;
- register char *e;
- ***************
- *** 1437,1463 ****
- static char *vert = "|";
-
- if (ninstr(string, string+len, vert, vert+1))
- ! return Nullstr;
- if (*string == '^')
- string++, len--;
- ! retstr = Str_new(86,len);
- ! str_nset(retstr,string,len);
- ! t = str_get(retstr);
- e = t + len;
- ! retstr->str_u.str_useful = 100;
- for (d=t; d < e; ) {
- switch (*d) {
- case '{':
- ! if (isdigit(d[1]))
- e = d;
- else
- goto defchar;
- break;
- case '.': case '[': case '$': case '(': case ')': case '|': case '+':
- e = d;
- break;
- case '\\':
- ! if (d[1] && index("wWbB0123456789sSdDlLuUE",d[1])) {
- e = d;
- break;
- }
- --- 1468,1495 ----
- static char *vert = "|";
-
- if (ninstr(string, string+len, vert, vert+1))
- ! return;
- if (*string == '^')
- string++, len--;
- ! tmpstr = Str_new(86,len);
- ! str_nset(tmpstr,string,len);
- ! t = str_get(tmpstr);
- e = t + len;
- ! tmpstr->str_u.str_useful = 100;
- for (d=t; d < e; ) {
- switch (*d) {
- case '{':
- ! if (isDIGIT(d[1]))
- e = d;
- else
- goto defchar;
- break;
- case '.': case '[': case '$': case '(': case ')': case '|': case '+':
- + case '^':
- e = d;
- break;
- case '\\':
- ! if (d[1] && index("wWbB0123456789sSdDlLuUExc",d[1])) {
- e = d;
- break;
- }
- ***************
- *** 1494,1511 ****
- }
- }
- if (d == t) {
- ! str_free(retstr);
- ! return Nullstr;
- }
- *d = '\0';
- ! retstr->str_cur = d - t;
- if (d == t+len)
- spat->spat_flags |= SPAT_ALL;
- if (*origstring != '^')
- spat->spat_flags |= SPAT_SCANFIRST;
- ! spat->spat_short = retstr;
- spat->spat_slen = d - t;
- - return retstr;
- }
-
- char *
- --- 1526,1542 ----
- }
- }
- if (d == t) {
- ! str_free(tmpstr);
- ! return;
- }
- *d = '\0';
- ! tmpstr->str_cur = d - t;
- if (d == t+len)
- spat->spat_flags |= SPAT_ALL;
- if (*origstring != '^')
- spat->spat_flags |= SPAT_SCANFIRST;
- ! spat->spat_short = tmpstr;
- spat->spat_slen = d - t;
- }
-
- char *
- ***************
- *** 1663,1677 ****
- arg->arg_type = O_ITEM;
- arg[1].arg_type = A_DOUBLE;
- arg[1].arg_ptr.arg_str = str_smake(str);
- ! d = scanident(d,bufend,buf);
- (void)stabent(buf,TRUE); /* make sure it's created */
- for (; *d; d++) {
- if (*d == '$' && d[1] && d[-1] != '\\' && d[1] != '|') {
- ! d = scanident(d,bufend,buf);
- (void)stabent(buf,TRUE);
- }
- else if (*d == '@' && d[-1] != '\\') {
- ! d = scanident(d,bufend,buf);
- if (strEQ(buf,"ARGV") || strEQ(buf,"ENV") ||
- strEQ(buf,"SIG") || strEQ(buf,"INC"))
- (void)stabent(buf,TRUE);
- --- 1694,1708 ----
- arg->arg_type = O_ITEM;
- arg[1].arg_type = A_DOUBLE;
- arg[1].arg_ptr.arg_str = str_smake(str);
- ! d = scanident(d,e,buf);
- (void)stabent(buf,TRUE); /* make sure it's created */
- for (; *d; d++) {
- if (*d == '$' && d[1] && d[-1] != '\\' && d[1] != '|') {
- ! d = scanident(d,e,buf);
- (void)stabent(buf,TRUE);
- }
- else if (*d == '@' && d[-1] != '\\') {
- ! d = scanident(d,e,buf);
- if (strEQ(buf,"ARGV") || strEQ(buf,"ENV") ||
- strEQ(buf,"SIG") || strEQ(buf,"INC"))
- (void)stabent(buf,TRUE);
- ***************
- *** 1701,1707 ****
- e = tmpstr->str_ptr + tmpstr->str_cur;
- for (t = tmpstr->str_ptr; t < e; t++) {
- if (*t == '$' && t[1] && (index("`'&+0123456789",t[1]) ||
- ! (t[1] == '{' /*}*/ && isdigit(t[2])) ))
- spat->spat_flags &= ~SPAT_CONST;
- }
- }
- --- 1732,1738 ----
- e = tmpstr->str_ptr + tmpstr->str_cur;
- for (t = tmpstr->str_ptr; t < e; t++) {
- if (*t == '$' && t[1] && (index("`'&+0123456789",t[1]) ||
- ! (t[1] == '{' /*}*/ && isDIGIT(t[2])) ))
- spat->spat_flags &= ~SPAT_CONST;
- }
- }
- ***************
- *** 1710,1716 ****
- s++;
- if ((spat->spat_repl[1].arg_type & A_MASK) == A_DOUBLE)
- spat->spat_repl[1].arg_type = A_SINGLE;
- ! spat->spat_repl = make_op(O_EVAL,2,
- spat->spat_repl,
- Nullarg,
- Nullarg);
- --- 1741,1749 ----
- s++;
- if ((spat->spat_repl[1].arg_type & A_MASK) == A_DOUBLE)
- spat->spat_repl[1].arg_type = A_SINGLE;
- ! spat->spat_repl = make_op(
- ! (spat->spat_repl[1].arg_type == A_SINGLE ? O_EVALONCE : O_EVAL),
- ! 2,
- spat->spat_repl,
- Nullarg,
- Nullarg);
- ***************
- *** 1950,1955 ****
- --- 1983,1991 ----
- switch (*s) {
- default:
- goto out;
- + case '_':
- + s++;
- + break;
- case '8': case '9':
- if (shift != 4)
- yyerror("Illegal octal digit");
- ***************
- *** 1984,1990 ****
- decimal:
- arg[1].arg_type = A_SINGLE;
- d = tokenbuf;
- ! while (isdigit(*s) || *s == '_') {
- if (*s == '_')
- s++;
- else
- --- 2020,2026 ----
- decimal:
- arg[1].arg_type = A_SINGLE;
- d = tokenbuf;
- ! while (isDIGIT(*s) || *s == '_') {
- if (*s == '_')
- s++;
- else
- ***************
- *** 1992,1998 ****
- }
- if (*s == '.' && s[1] && index("0123456789eE ;",s[1])) {
- *d++ = *s++;
- ! while (isdigit(*s) || *s == '_') {
- if (*s == '_')
- s++;
- else
- --- 2028,2034 ----
- }
- if (*s == '.' && s[1] && index("0123456789eE ;",s[1])) {
- *d++ = *s++;
- ! while (isDIGIT(*s) || *s == '_') {
- if (*s == '_')
- s++;
- else
- ***************
- *** 2003,2009 ****
- *d++ = *s++;
- if (*s == '+' || *s == '-')
- *d++ = *s++;
- ! while (isdigit(*s))
- *d++ = *s++;
- }
- *d = '\0';
- --- 2039,2045 ----
- *d++ = *s++;
- if (*s == '+' || *s == '-')
- *d++ = *s++;
- ! while (isDIGIT(*s))
- *d++ = *s++;
- }
- *d = '\0';
- ***************
- *** 2034,2040 ****
- s++, term = '\'';
- else
- term = '"';
- ! while (isascii(*s) && (isalpha(*s) || isdigit(*s) || *s == '_'))
- *d++ = *s++;
- } /* assuming tokenbuf won't clobber */
- *d++ = '\n';
- --- 2070,2076 ----
- s++, term = '\'';
- else
- term = '"';
- ! while (isALNUM(*s))
- *d++ = *s++;
- } /* assuming tokenbuf won't clobber */
- *d++ = '\n';
- ***************
- *** 2057,2064 ****
- if (s < bufend)
- s++;
- if (*d == '$') d++;
- ! while (*d &&
- ! (isalpha(*d) || isdigit(*d) || *d == '_' || *d == '\''))
- d++;
- if (d - tokenbuf != len) {
- d = tokenbuf;
- --- 2093,2099 ----
- if (s < bufend)
- s++;
- if (*d == '$') d++;
- ! while (*d && (isALNUM(*d) || *d == '\''))
- d++;
- if (d - tokenbuf != len) {
- d = tokenbuf;
- ***************
- *** 2209,2215 ****
- s = tmpstr->str_ptr;
- send = s + tmpstr->str_cur;
- while (s < send) { /* see if we can make SINGLE */
- ! if (*s == '\\' && s[1] && isdigit(s[1]) && !isdigit(s[2]) &&
- !alwaysdollar && s[1] != '0')
- *s = '$'; /* grandfather \digit in subst */
- if ((*s == '$' || *s == '@') && s+1 < send &&
- --- 2244,2250 ----
- s = tmpstr->str_ptr;
- send = s + tmpstr->str_cur;
- while (s < send) { /* see if we can make SINGLE */
- ! if (*s == '\\' && s[1] && isDIGIT(s[1]) && !isDIGIT(s[2]) &&
- !alwaysdollar && s[1] != '0')
- *s = '$'; /* grandfather \digit in subst */
- if ((*s == '$' || *s == '@') && s+1 < send &&
- ***************
- *** 2228,2233 ****
- --- 2263,2270 ----
- if ((*s == '$' && s+1 < send &&
- (alwaysdollar || /*(*/ (s[1] != ')' && s[1] != '|')) ) ||
- (*s == '@' && s+1 < send) ) {
- + if (s[1] == '#' && (isALPHA(s[2]) || s[2] == '_'))
- + *d++ = *s++;
- len = scanident(s,send,tokenbuf) - s;
- if (*s == '$' || strEQ(tokenbuf,"ARGV")
- || strEQ(tokenbuf,"ENV")
- ***************
- *** 2258,2264 ****
- case 'c':
- s++;
- *d = *s++;
- ! if (islower(*d))
- *d = toupper(*d);
- *d++ ^= 64;
- continue;
- --- 2295,2301 ----
- case 'c':
- s++;
- *d = *s++;
- ! if (isLOWER(*d))
- *d = toupper(*d);
- *d++ ^= 64;
- continue;
- ***************
- *** 2337,2342 ****
- --- 2374,2380 ----
- astore(stab_xarray(curcmd->c_filestab), (int)curcmd->c_line,tmpstr);
- }
- if (*s == '.') {
- + /*SUPPRESS 530*/
- for (t = s+1; *t == ' ' || *t == '\t'; t++) ;
- if (*t == '\n') {
- bufptr = s;
- ***************
- *** 2479,2485 ****
- }
- else {
- eol[-1] = '\n';
- ! while (s < eol && isspace(*s))
- s++;
- t = s;
- while (s < eol) {
- --- 2517,2523 ----
- }
- else {
- eol[-1] = '\n';
- ! while (s < eol && isSPACE(*s))
- s++;
- t = s;
- while (s < eol) {
- ***************
- *** 2487,2493 ****
- case ' ': case '\t': case '\n': case ';':
- str_ncat(str, t, s - t);
- str_ncat(str, "," ,1);
- ! while (s < eol && (isspace(*s) || *s == ';'))
- s++;
- t = s;
- break;
- --- 2525,2531 ----
- case ' ': case '\t': case '\n': case ';':
- str_ncat(str, t, s - t);
- str_ncat(str, "," ,1);
- ! while (s < eol && (isSPACE(*s) || *s == ';'))
- s++;
- t = s;
- break;
-
- Index: hints/ultrix_4.sh
- *** hints/ultrix_4.sh.old Tue Nov 5 19:26:44 1991
- --- hints/ultrix_4.sh Tue Nov 5 19:26:45 1991
- ***************
- *** 6,11 ****
- --- 6,14 ----
- may cause utime() to work incorrectly. If so, regression test io/fs
- may fail if run under NFS. Ignore the failure.
- EOF
- + case "$tmp" in
- + *4.2*) d_volatile=undef;;
- + esac
- ;;
- esac
- case "$tmp" in
-
- Index: usub/usersub.c
- Prereq: 4.0
- *** usub/usersub.c.old Tue Nov 5 19:28:24 1991
- --- usub/usersub.c Tue Nov 5 19:28:25 1991
- ***************
- *** 1,6 ****
- ! /* $Header: usersub.c,v 4.0 91/03/20 01:56:34 lwall Locked $
- *
- * $Log: usersub.c,v $
- * Revision 4.0 91/03/20 01:56:34 lwall
- * 4.0 baseline.
- *
- --- 1,9 ----
- ! /* $RCSfile: usersub.c,v $$Revision: 4.0.1.1 $$Date: 91/11/05 19:07:24 $
- *
- * $Log: usersub.c,v $
- + * Revision 4.0.1.1 91/11/05 19:07:24 lwall
- + * patch11: there are now subroutines for calling back from C into Perl
- + *
- * Revision 4.0 91/03/20 01:56:34 lwall
- * 4.0 baseline.
- *
- ***************
- *** 18,20 ****
- --- 21,72 ----
- init_curses();
- }
-
- + /* Be sure to refetch the stack pointer after calling these routines. */
- +
- + int
- + callback(subname, sp, gimme, hasargs, numargs)
- + char *subname;
- + int sp; /* stack pointer after args are pushed */
- + int gimme; /* called in array or scalar context */
- + int hasargs; /* whether to create a @_ array for routine */
- + int numargs; /* how many args are pushed on the stack */
- + {
- + static ARG myarg[3]; /* fake syntax tree node */
- + int arglast[3];
- +
- + arglast[2] = sp;
- + sp -= numargs;
- + arglast[1] = sp--;
- + arglast[0] = sp;
- +
- + if (!myarg[0].arg_ptr.arg_str)
- + myarg[0].arg_ptr.arg_str = str_make("",0);
- +
- + myarg[1].arg_type = A_WORD;
- + myarg[1].arg_ptr.arg_stab = stabent(subname, FALSE);
- +
- + myarg[2].arg_type = hasargs ? A_EXPR : A_NULL;
- +
- + return do_subr(myarg, gimme, arglast);
- + }
- +
- + int
- + callv(subname, sp, gimme, argv)
- + char *subname;
- + register int sp; /* current stack pointer */
- + int gimme; /* called in array or scalar context */
- + register char **argv; /* null terminated arg list, NULL for no arglist */
- + {
- + register int items = 0;
- + int hasargs = (argv != 0);
- +
- + astore(stack, ++sp, Nullstr); /* reserve spot for 1st return arg */
- + if (hasargs) {
- + while (*argv) {
- + astore(stack, ++sp, str_2mortal(str_make(*argv,0)));
- + items++;
- + argv++;
- + }
- + }
- + return callback(subname, sp, gimme, hasargs, items);
- + }
-
- Index: util.c
- *** util.c.old Tue Nov 5 19:28:27 1991
- --- util.c Tue Nov 5 19:28:28 1991
- ***************
- *** 1,4 ****
- ! /* $RCSfile: util.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 12:10:42 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: util.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 19:18:26 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,17 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: util.c,v $
- + * Revision 4.0.1.3 91/11/05 19:18:26 lwall
- + * patch11: safe malloc code now integrated into Perl's malloc when possible
- + * patch11: index("little", "longer string") could visit faraway places
- + * patch11: warn '-' x 10000 dumped core
- + * patch11: forked exec on non-existent program now issues a warning
- + *
- * Revision 4.0.1.2 91/06/07 12:10:42 lwall
- * patch4: new copyright notice
- * patch4: made some allowances for "semi-standard" C
- ***************
- *** 20,25 ****
- --- 26,32 ----
- * 4.0 baseline.
- *
- */
- + /*SUPPRESS 112*/
-
- #include "EXTERN.h"
- #include "perl.h"
- ***************
- *** 45,50 ****
- --- 52,59 ----
-
- #define FLUSH
-
- + #ifndef safemalloc
- +
- static char nomem[] = "Out of memory!\n";
-
- /* paranoid version of malloc */
- ***************
- *** 173,182 ****
- --- 182,194 ----
- # endif
- #endif
- if (where) {
- + /*SUPPRESS 701*/
- free(where);
- }
- }
-
- + #endif /* !safemalloc */
- +
- #ifdef LEAKTEST
-
- #define ALIGN sizeof(long)
- ***************
- *** 222,228 ****
- register int i;
-
- for (i = 0; i < MAXXCOUNT; i++) {
- ! if (xcount[i] != lastxcount[i]) {
- fprintf(stderr,"%2d %2d\t%ld\n", i / 100, i % 100, xcount[i]);
- lastxcount[i] = xcount[i];
- }
- --- 234,240 ----
- register int i;
-
- for (i = 0; i < MAXXCOUNT; i++) {
- ! if (xcount[i] > lastxcount[i]) {
- fprintf(stderr,"%2d %2d\t%ld\n", i / 100, i % 100, xcount[i]);
- lastxcount[i] = xcount[i];
- }
- ***************
- *** 307,312 ****
- --- 319,326 ----
-
- if (!first && little > littleend)
- return big;
- + if (bigend - big < littleend - little)
- + return Nullch;
- bigend -= littleend - little++;
- while (big <= bigend) {
- if (*big++ != first)
- ***************
- *** 433,440 ****
- {
- register unsigned char *s;
- register unsigned char *table;
- ! register int i;
- ! register int len = str->str_cur;
- int rarest = 0;
- unsigned int frequency = 256;
-
- --- 447,454 ----
- {
- register unsigned char *s;
- register unsigned char *table;
- ! register unsigned int i;
- ! register unsigned int len = str->str_cur;
- int rarest = 0;
- unsigned int frequency = 256;
-
- ***************
- *** 564,569 ****
- --- 578,584 ----
- if (littlestr->str_pok & SP_CASEFOLD) { /* case insensitive? */
- if (s < bigend) {
- top1:
- + /*SUPPRESS 560*/
- if (tmp = table[*s]) {
- #ifdef POINTERRIGOR
- if (bigend - s > tmp) {
- ***************
- *** 597,602 ****
- --- 612,618 ----
- else {
- if (s < bigend) {
- top2:
- + /*SUPPRESS 560*/
- if (tmp = table[*s]) {
- #ifdef POINTERRIGOR
- if (bigend - s > tmp) {
- ***************
- *** 660,666 ****
- big = Null(unsigned char*);
- #endif
- bigend = big + bigstr->str_cur;
- - big -= previous;
- while (pos < previous) {
- #ifndef lint
- if (!(pos += screamnext[pos]))
- --- 676,681 ----
- ***************
- *** 667,676 ****
- #endif
- return Nullch;
- }
- if (littlestr->str_pok & SP_CASEFOLD) { /* case insignificant? */
- do {
- ! if (big[pos] != first && big[pos] != fold[first])
- ! continue;
- for (x=big+pos+1,s=little; s < littleend; /**/ ) {
- if (x >= bigend)
- return Nullch;
- --- 682,757 ----
- #endif
- return Nullch;
- }
- + #ifdef POINTERRIGOR
- if (littlestr->str_pok & SP_CASEFOLD) { /* case insignificant? */
- do {
- ! #ifndef lint
- ! while (big[pos-previous] != first && big[pos-previous] != fold[first]
- ! && (pos += screamnext[pos]) )
- ! /*SUPPRESS 530*/
- ! ;
- ! #endif
- ! for (x=big+pos+1-previous,s=little; s < littleend; /**/ ) {
- ! if (x >= bigend)
- ! return Nullch;
- ! if (*s++ != *x++ && fold[*(s-1)] != *(x-1)) {
- ! s--;
- ! break;
- ! }
- ! }
- ! if (s == littleend)
- ! #ifndef lint
- ! return (char *)(big+pos-previous);
- ! #else
- ! return Nullch;
- ! #endif
- ! } while (
- ! #ifndef lint
- ! pos += screamnext[pos] /* does this goof up anywhere? */
- ! #else
- ! pos += screamnext[0]
- ! #endif
- ! );
- ! }
- ! else {
- ! do {
- ! #ifndef lint
- ! while (big[pos-previous] != first && (pos += screamnext[pos]))
- ! /*SUPPRESS 530*/
- ! ;
- ! #endif
- ! for (x=big+pos+1-previous,s=little; s < littleend; /**/ ) {
- ! if (x >= bigend)
- ! return Nullch;
- ! if (*s++ != *x++) {
- ! s--;
- ! break;
- ! }
- ! }
- ! if (s == littleend)
- ! #ifndef lint
- ! return (char *)(big+pos-previous);
- ! #else
- ! return Nullch;
- ! #endif
- ! } while (
- ! #ifndef lint
- ! pos += screamnext[pos]
- ! #else
- ! pos += screamnext[0]
- ! #endif
- ! );
- ! }
- ! #else /* !POINTERRIGOR */
- ! big -= previous;
- ! if (littlestr->str_pok & SP_CASEFOLD) { /* case insignificant? */
- ! do {
- ! #ifndef lint
- ! while (big[pos] != first && big[pos] != fold[first]
- ! && (pos += screamnext[pos]) )
- ! /*SUPPRESS 530*/
- ! ;
- ! #endif
- for (x=big+pos+1,s=little; s < littleend; /**/ ) {
- if (x >= bigend)
- return Nullch;
- ***************
- *** 695,702 ****
- }
- else {
- do {
- ! if (big[pos] != first)
- ! continue;
- for (x=big+pos+1,s=little; s < littleend; /**/ ) {
- if (x >= bigend)
- return Nullch;
- --- 776,786 ----
- }
- else {
- do {
- ! #ifndef lint
- ! while (big[pos] != first && (pos += screamnext[pos]))
- ! /*SUPPRESS 530*/
- ! ;
- ! #endif
- for (x=big+pos+1,s=little; s < littleend; /**/ ) {
- if (x >= bigend)
- return Nullch;
- ***************
- *** 719,724 ****
- --- 803,809 ----
- #endif
- );
- }
- + #endif /* POINTERRIGOR */
- return Nullch;
- }
-
- ***************
- *** 774,783 ****
- long a1, a2, a3, a4;
- {
- char *s;
-
- s = buf;
- ! (void)sprintf(s,pat,a1,a2,a3,a4);
- ! s += strlen(s);
- if (s[-1] != '\n') {
- if (curcmd->c_line) {
- (void)sprintf(s," at %s line %ld",
- --- 859,878 ----
- long a1, a2, a3, a4;
- {
- char *s;
- + int usermess = strEQ(pat,"%s");
- + STR *tmpstr;
-
- s = buf;
- ! if (usermess) {
- ! tmpstr = str_mortal(&str_undef);
- ! str_set(tmpstr, (char*)a1);
- ! *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
- ! }
- ! else {
- ! (void)sprintf(s,pat,a1,a2,a3,a4);
- ! s += strlen(s);
- ! }
- !
- if (s[-1] != '\n') {
- if (curcmd->c_line) {
- (void)sprintf(s," at %s line %ld",
- ***************
- *** 793,799 ****
- --- 888,900 ----
- s += strlen(s);
- }
- (void)strcpy(s,".\n");
- + if (usermess)
- + str_cat(tmpstr,buf+1);
- }
- + if (usermess)
- + return tmpstr->str_ptr;
- + else
- + return buf;
- }
-
- /*VARARGS1*/
- ***************
- *** 804,813 ****
- extern FILE *e_fp;
- extern char *e_tmpname;
- char *tmps;
-
- ! mess(pat,a1,a2,a3,a4);
- if (in_eval) {
- ! str_set(stab_val(stabent("@",TRUE)),buf);
- tmps = "_EVAL_";
- while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
- strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
- --- 905,915 ----
- extern FILE *e_fp;
- extern char *e_tmpname;
- char *tmps;
- + char *message;
-
- ! message = mess(pat,a1,a2,a3,a4);
- if (in_eval) {
- ! str_set(stab_val(stabent("@",TRUE)),message);
- tmps = "_EVAL_";
- while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
- strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
- ***************
- *** 831,837 ****
- }
- longjmp(loop_stack[loop_ptr].loop_env, 1);
- }
- ! fputs(buf,stderr);
- (void)fflush(stderr);
- if (e_fp)
- (void)UNLINK(e_tmpname);
- --- 933,939 ----
- }
- longjmp(loop_stack[loop_ptr].loop_env, 1);
- }
- ! fputs(message,stderr);
- (void)fflush(stderr);
- if (e_fp)
- (void)UNLINK(e_tmpname);
- ***************
- *** 844,851 ****
- char *pat;
- long a1, a2, a3, a4;
- {
- ! mess(pat,a1,a2,a3,a4);
- ! fputs(buf,stderr);
- #ifdef LEAKTEST
- #ifdef DEBUGGING
- if (debug & 4096)
- --- 946,955 ----
- char *pat;
- long a1, a2, a3, a4;
- {
- ! char *message;
- !
- ! message = mess(pat,a1,a2,a3,a4);
- ! fputs(message,stderr);
- #ifdef LEAKTEST
- #ifdef DEBUGGING
- if (debug & 4096)
- ***************
- *** 856,866 ****
- --- 960,973 ----
- }
- #else
- /*VARARGS0*/
- + char *
- mess(args)
- va_list args;
- {
- char *pat;
- char *s;
- + STR *tmpstr;
- + int usermess;
- #ifndef HAS_VPRINTF
- #ifdef CHARVSPRINTF
- char *vsprintf();
- ***************
- *** 869,883 ****
- #endif
- #endif
-
- - s = buf;
- #ifdef lint
- pat = Nullch;
- #else
- pat = va_arg(args, char *);
- #endif
- ! (void) vsprintf(s,pat,args);
-
- - s += strlen(s);
- if (s[-1] != '\n') {
- if (curcmd->c_line) {
- (void)sprintf(s," at %s line %ld",
- --- 976,998 ----
- #endif
- #endif
-
- #ifdef lint
- pat = Nullch;
- #else
- pat = va_arg(args, char *);
- #endif
- ! s = buf;
- ! usermess = strEQ(pat, "%s");
- ! if (usermess) {
- ! tmpstr = str_mortal(&str_undef);
- ! str_set(tmpstr, va_arg(args, char *));
- ! *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
- ! }
- ! else {
- ! (void) vsprintf(s,pat,args);
- ! s += strlen(s);
- ! }
-
- if (s[-1] != '\n') {
- if (curcmd->c_line) {
- (void)sprintf(s," at %s line %ld",
- ***************
- *** 893,899 ****
- --- 1008,1021 ----
- s += strlen(s);
- }
- (void)strcpy(s,".\n");
- + if (usermess)
- + str_cat(tmpstr,buf+1);
- }
- +
- + if (usermess)
- + return tmpstr->str_ptr;
- + else
- + return buf;
- }
-
- /*VARARGS0*/
- ***************
- *** 904,909 ****
- --- 1026,1032 ----
- extern FILE *e_fp;
- extern char *e_tmpname;
- char *tmps;
- + char *message;
-
- #ifndef lint
- va_start(args);
- ***************
- *** 910,919 ****
- #else
- args = 0;
- #endif
- ! mess(args);
- va_end(args);
- if (in_eval) {
- ! str_set(stab_val(stabent("@",TRUE)),buf);
- tmps = "_EVAL_";
- while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
- strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
- --- 1033,1042 ----
- #else
- args = 0;
- #endif
- ! message = mess(args);
- va_end(args);
- if (in_eval) {
- ! str_set(stab_val(stabent("@",TRUE)),message);
- tmps = "_EVAL_";
- while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
- strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
- ***************
- *** 937,943 ****
- }
- longjmp(loop_stack[loop_ptr].loop_env, 1);
- }
- ! fputs(buf,stderr);
- (void)fflush(stderr);
- if (e_fp)
- (void)UNLINK(e_tmpname);
- --- 1060,1066 ----
- }
- longjmp(loop_stack[loop_ptr].loop_env, 1);
- }
- ! fputs(message,stderr);
- (void)fflush(stderr);
- if (e_fp)
- (void)UNLINK(e_tmpname);
- ***************
- *** 950,955 ****
- --- 1073,1079 ----
- va_dcl
- {
- va_list args;
- + char *message;
-
- #ifndef lint
- va_start(args);
- ***************
- *** 956,965 ****
- #else
- args = 0;
- #endif
- ! mess(args);
- va_end(args);
-
- ! fputs(buf,stderr);
- #ifdef LEAKTEST
- #ifdef DEBUGGING
- if (debug & 4096)
- --- 1080,1089 ----
- #else
- args = 0;
- #endif
- ! message = mess(args);
- va_end(args);
-
- ! fputs(message,stderr);
- #ifdef LEAKTEST
- #ifdef DEBUGGING
- if (debug & 4096)
- ***************
- *** 981,986 ****
- --- 1105,1111 ----
- int max;
- char **tmpenv;
-
- + /*SUPPRESS 530*/
- for (max = i; environ[max]; max++) ;
- New(901,tmpenv, max+2, char*);
- for (j=0; j<max; j++) /* copy environment */
- ***************
- *** 1242,1249 ****
- --- 1367,1376 ----
- close(fd);
- #endif
- do_exec(cmd); /* may or may not use the shell */
- + warn("Can't exec \"%s\": %s", cmd, strerror(errno));
- _exit(1);
- }
- + /*SUPPRESS 560*/
- if (tmpstab = stabent("$",allstabs))
- str_numset(STAB_STR(tmpstab),(double)getpid());
- forkprocess = 0;
- ***************
- *** 1321,1329 ****
- int pid;
-
- str = afetch(fdpid,fileno(ptr),TRUE);
- astore(fdpid,fileno(ptr),Nullstr);
- fclose(ptr);
- - pid = (int)str->str_u.str_useful;
- hstat = signal(SIGHUP, SIG_IGN);
- istat = signal(SIGINT, SIG_IGN);
- qstat = signal(SIGQUIT, SIG_IGN);
- --- 1448,1456 ----
- int pid;
-
- str = afetch(fdpid,fileno(ptr),TRUE);
- + pid = (int)str->str_u.str_useful;
- astore(fdpid,fileno(ptr),Nullstr);
- fclose(ptr);
- hstat = signal(SIGHUP, SIG_IGN);
- istat = signal(SIGINT, SIG_IGN);
- qstat = signal(SIGQUIT, SIG_IGN);
- ***************
- *** 1340,1348 ****
- --- 1467,1477 ----
- int *statusp;
- int flags;
- {
- + #if !defined(HAS_WAIT4) && !defined(HAS_WAITPID)
- int result;
- STR *str;
- char spid[16];
- + #endif
-
- if (!pid)
- return -1;
- ***************
- *** 1387,1392 ****
- --- 1516,1522 ----
- #endif
- }
-
- + /*SUPPRESS 590*/
- pidgone(pid,status)
- int pid;
- int status;
-
- Index: util.h
- *** util.h.old Tue Nov 5 19:28:31 1991
- --- util.h Tue Nov 5 19:28:31 1991
- ***************
- *** 1,4 ****
- ! /* $RCSfile: util.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:11:00 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: util.h,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:18:40 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: util.h,v $
- + * Revision 4.0.1.2 91/11/05 19:18:40 lwall
- + * patch11: safe malloc code now integrated into Perl's malloc when possible
- + *
- * Revision 4.0.1.1 91/06/07 12:11:00 lwall
- * patch4: new copyright notice
- *
- ***************
- *** 17,24 ****
- --- 20,29 ----
- EXT int *screamfirst INIT(Null(int*));
- EXT int *screamnext INIT(Null(int*));
-
- + #ifndef safemalloc
- char *safemalloc();
- char *saferealloc();
- + #endif
- char *cpytill();
- char *instr();
- char *fbminstr();
-
- *** End of Patch 17 ***
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-