summaryrefslogtreecommitdiff
path: root/str.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1991-06-09 12:36:21 +0000
committerLarry Wall <lwall@netlabs.com>1991-06-09 12:36:21 +0000
commit1462b684862954f3522657efc93a3264698e4a9f (patch)
treec92554143d0076f4bd8a6f41f8caa3315eef035d /str.c
parentd48672a2009b4897fb5bf74d6723c050cdd015e0 (diff)
downloadperl-1462b684862954f3522657efc93a3264698e4a9f.tar.gz
perl 4.0 patch 10: (combined patch)
Subject: pack(hh,1) dumped core Subject: read didn't work from character special files open for writing Subject: close-on-exec wrongly set on system file descriptors Subject: //g only worked first time through Subject: perl -v printed incorrect copyright notice Subject: certain pattern optimizations were botched Subject: documented some newer features in addenda Subject: $) and $| incorrectly handled in run-time patterns Subject: added tests for case-insensitive regular expressions Subject: m'$foo' now treats string as single quoted
Diffstat (limited to 'str.c')
-rw-r--r--str.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/str.c b/str.c
index 5ff6a41e14..cf5e1f902d 100644
--- a/str.c
+++ b/str.c
@@ -1,4 +1,4 @@
-/* $RCSfile: str.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:13 $
+/* $RCSfile: str.c,v $$Revision: 4.0.1.3 $$Date: 91/06/10 01:27:54 $
*
* Copyright (c) 1991, Larry Wall
*
@@ -6,6 +6,9 @@
* License or the Artistic License, as specified in the README file.
*
* $Log: str.c,v $
+ * Revision 4.0.1.3 91/06/10 01:27:54 lwall
+ * patch10: $) and $| incorrectly handled in run-time patterns
+ *
* Revision 4.0.1.2 91/06/07 11:58:13 lwall
* patch4: new copyright notice
* patch4: taint check on undefined string could cause core dump
@@ -939,8 +942,14 @@ STR *src;
++s;
t = s;
}
- else if ((*s == '@' || (*s == '$' && !index(nointrp,s[1]))) &&
- s+1 < send) {
+ else if (*s == '$' && s+1 < send && *nointrp && index(nointrp,s[1])) {
+ str_ncat(str, t, s - t);
+ str_ncat(str, "$b", 2);
+ str_ncat(str, s, 2);
+ s += 2;
+ t = s;
+ }
+ else if ((*s == '@' || *s == '$') && s+1 < send) {
str_ncat(str,t,s-t);
t = s;
if (*s == '$' && s[1] == '#' && (isalpha(s[2]) || s[2] == '_'))
@@ -1171,6 +1180,9 @@ int sp;
if (s-t > 0)
str_ncat(str,t,s-t);
switch(*++s) {
+ default:
+ fatal("panic: unknown interp cookie\n");
+ break;
case 'a':
str_scat(str,*++elem);
break;