diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-13 10:01:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-05-13 10:01:09 +0000 |
commit | ccc13869790d312f614128204c5546d5e9ad0b3f (patch) | |
tree | 4a834e153187f75cc2a336f742aea845f55557e6 /regex.c | |
parent | c6ac6cb4542b845eb4c18a9e80e15f8deab4f54a (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.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -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; |