summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-13 10:18:04 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-13 10:18:04 +0000
commitbe2f26c1b47534c17203f2a5929e1d9a4f573f8c (patch)
tree2df06863a7bc023ae2b16d73c0dd4ee00cbbe18e /re.c
parent61c72e676598c44d8ced38c873205cb34093cb4b (diff)
* re.c (rb_reg_desc): separate RE_OPTION_MULTILINE
* re.c (rb_reg_options): add RE_OPTION_{POSIXLINE,RE_OPTION_MULTILINE,RE_OPTION_EXTENDED} git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/re.c b/re.c
index bb9898fdb4..06e58f535a 100644
--- a/re.c
+++ b/re.c
@@ -288,11 +288,11 @@ rb_reg_desc(s, len, re)
rb_str_cat2(str, "/");
if (re) {
rb_reg_check(re);
- if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
- rb_str_cat2(str, "m");
/* /p is obsolete; to be removed */
if ((RREGEXP(re)->ptr->options & RE_OPTION_POSIXLINE) == RE_OPTION_POSIXLINE)
rb_str_cat2(str, "p");
+ else if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
+ rb_str_cat2(str, "m");
if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)
rb_str_cat2(str, "i");
if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED)
@@ -1123,6 +1123,12 @@ rb_reg_options(re)
rb_reg_check(re);
if (RREGEXP(re)->ptr->options & RE_OPTION_IGNORECASE)
options |= RE_OPTION_IGNORECASE;
+ if ((RREGEXP(re)->ptr->options & RE_OPTION_POSIXLINE) == RE_OPTION_POSIXLINE)
+ options |= RE_OPTION_POSIXLINE;
+ else if (RREGEXP(re)->ptr->options & RE_OPTION_MULTILINE)
+ options |= RE_OPTION_MULTILINE;
+ if (RREGEXP(re)->ptr->options & RE_OPTION_EXTENDED)
+ options |= RE_OPTION_EXTENDED;
if (FL_TEST(re, KCODE_FIXED)) {
options |= rb_reg_get_kcode(re);
}