summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-13 10:01:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-13 10:01:09 +0000
commitccc13869790d312f614128204c5546d5e9ad0b3f (patch)
tree4a834e153187f75cc2a336f742aea845f55557e6 /regex.c
parentc6ac6cb4542b845eb4c18a9e80e15f8deab4f54a (diff)
990513
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/regex.c b/regex.c
index 0cd01b2..c6167b0 100644
--- a/regex.c
+++ b/regex.c
@@ -1182,7 +1182,10 @@ re_compile_pattern(pattern, size, bufp)
switch (c) {
case '$':
- {
+ if (bufp->options & RE_OPTION_POSIXLINE) {
+ BUFPUSH(endbuf2);
+ }
+ else {
p0 = p;
/* When testing what follows the $,
look past the \-constructs that don't consume anything. */
@@ -1195,10 +1198,13 @@ re_compile_pattern(pattern, size, bufp)
break;
}
BUFPUSH(endline);
- break;
}
+ break;
case '^':
- BUFPUSH(begline);
+ if (bufp->options & RE_OPTION_POSIXLINE)
+ BUFPUSH(begbuf);
+ else
+ BUFPUSH(begline);
break;
case '+':
@@ -1313,8 +1319,6 @@ re_compile_pattern(pattern, size, bufp)
if ((enum regexpcode)b[-2] == charset_not) {
if (bufp->options & RE_OPTION_POSIXLINE)
SET_LIST_BIT ('\n');
- else
- SET_LIST_BIT ('\0');
}
/* Read in characters and ranges, setting map bits. */
@@ -2042,9 +2046,11 @@ re_compile_pattern(pattern, size, bufp)
break;
case 'Z':
- BUFPUSH(endbuf2);
- break;
-
+ if ((bufp->options & RE_OPTION_POSIXLINE) == 0) {
+ BUFPUSH(endbuf2);
+ break;
+ }
+ /* fall through */
case 'z':
BUFPUSH(endbuf);
break;