diff options
author | Larry Wall <lwall@netlabs.com> | 1991-04-11 20:32:32 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-04-11 20:32:32 +0000 |
commit | 35c8bce761056f470189967ccc824e04467151df (patch) | |
tree | 9ee76bba81900f86af5a1070bdd69d3987201c52 /str.c | |
parent | 1c3d792e8fc9c2a36edfbd6c01156ef7e635040f (diff) | |
download | perl-35c8bce761056f470189967ccc824e04467151df.tar.gz |
perl 4.0 patch 2: Patch 1 continued
Diffstat (limited to 'str.c')
-rw-r--r-- | str.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1,5 +1,4 @@ -#undef STDSTDIO -/* $Header: str.c,v 4.0 91/03/20 01:39:55 lwall Locked $ +/* $RCSfile: str.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:15:30 $ * * Copyright (c) 1989, Larry Wall * @@ -7,6 +6,11 @@ * as specified in the README file that comes with the perl 3.0 kit. * * $Log: str.c,v $ + * Revision 4.0.1.1 91/04/12 09:15:30 lwall + * patch1: fixed undefined environ problem + * patch1: substr($ENV{"PATH"},0,0) = "/foo:" didn't modify environment + * patch1: $foo .= <BAR> could cause core dump for certain lengths of $foo + * * Revision 4.0 91/03/20 01:39:55 lwall * 4.0 baseline. * @@ -16,10 +20,6 @@ #include "perl.h" #include "perly.h" -#ifndef __STDC__ -extern char **environ; -#endif /* ! __STDC__ */ - #ifndef str_get char * str_get(str) @@ -519,10 +519,12 @@ STRLEN littlelen; *--bigend = *--midend; (void)bcopy(little,big+offset,littlelen); bigstr->str_cur += i; + STABSET(bigstr); return; } else if (i == 0) { (void)bcopy(little,bigstr->str_ptr+offset,len); + STABSET(bigstr); return; } @@ -734,9 +736,9 @@ int append; str->str_nok = 0; /* invalidate number */ str->str_pok = 1; /* validate pointer */ if (str->str_len <= cnt + 1) { /* make sure we have the room */ - if (cnt > 80 && str->str_len > 0) { - shortbuffered = cnt - str->str_len + 1; - cnt = str->str_len - 1; + if (cnt > 80 && str->str_len > append) { + shortbuffered = cnt - str->str_len + append + 1; + cnt -= shortbuffered; } else { shortbuffered = 0; |