summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-02 11:38:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-02 11:38:20 +0000
commit765255b737235a65daea6679c4672541bb67ecb4 (patch)
tree5ea517fae24a858cd204bbbe20e6d695c6472eae /re.c
parente9f9915a4c305ac02d8634b14579119433bc7b43 (diff)
* array.c (rb_ary_sort_bang): returns self, even if its length is
less than 2. * eval.c (POP_VARS): propagate DVAR_DONT_RECYCLE, if SCOPE_DONT_RECYCLE of ruby_scope is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/re.c b/re.c
index 865d767..ef614dd 100644
--- a/re.c
+++ b/re.c
@@ -389,9 +389,9 @@ rb_reg_kcode_m(re)
}
static Regexp*
-make_regexp(s, len, flag)
+make_regexp(s, len, flags)
const char *s;
- int len, flag;
+ int len, flags;
{
Regexp *rp;
char *err;
@@ -408,8 +408,8 @@ make_regexp(s, len, flag)
rp->buffer = ALLOC_N(char, 16);
rp->allocated = 16;
rp->fastmap = ALLOC_N(char, 256);
- if (flag) {
- rp->options = flag;
+ if (flags) {
+ rp->options = flags;
}
err = re_compile_pattern(s, len, rp);
if (err != NULL) {
@@ -973,30 +973,30 @@ rb_reg_initialize_m(argc, argv, self)
VALUE self;
{
VALUE src;
- int flag = 0;
+ int flags = 0;
if (argc == 0 || argc > 3) {
rb_raise(rb_eArgError, "wrong # of argument");
}
if (argc >= 2) {
- if (FIXNUM_P(argv[1])) flag = FIX2INT(argv[1]);
- else if (RTEST(argv[1])) flag = RE_OPTION_IGNORECASE;
+ if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]);
+ else if (RTEST(argv[1])) flags = RE_OPTION_IGNORECASE;
}
if (argc == 3) {
char *kcode = STR2CSTR(argv[2]);
switch (kcode[0]) {
case 'n': case 'N':
- flag |= 16;
+ flags |= 16;
break;
case 'e': case 'E':
- flag |= 32;
+ flags |= 32;
break;
case 's': case 'S':
- flag |= 48;
+ flags |= 48;
break;
case 'u': case 'U':
- flag |= 64;
+ flags |= 64;
break;
default:
break;
@@ -1006,14 +1006,14 @@ rb_reg_initialize_m(argc, argv, self)
src = argv[0];
if (TYPE(src) == T_REGEXP) {
rb_reg_check(src);
- rb_reg_initialize(self, RREGEXP(src)->str, RREGEXP(src)->len, flag);
+ rb_reg_initialize(self, RREGEXP(src)->str, RREGEXP(src)->len, flags);
}
else {
char *p;
int len;
p = rb_str2cstr(src, &len);
- rb_reg_initialize(self, p, len, flag);
+ rb_reg_initialize(self, p, len, flags);
}
return self;
}