mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (rb_reg_initialize_m): allow binary encoding option.
[ruby-dev:32083] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
24c863cf84
commit
81ed881511
3 changed files with 19 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Oct 17 01:57:06 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_initialize_m): allow binary encoding option.
|
||||
[ruby-dev:32083]
|
||||
|
||||
Tue Oct 16 19:48:01 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* re.c (rb_reg_s_union): check for encoding of original object.
|
||||
|
|
12
re.c
12
re.c
|
@ -1573,7 +1573,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
|
|||
int flags = 0;
|
||||
VALUE str;
|
||||
|
||||
if (argc == 0 || argc > 2) {
|
||||
if (argc == 0 || argc > 3) {
|
||||
rb_raise(rb_eArgError, "wrong number of arguments");
|
||||
}
|
||||
if (TYPE(argv[0]) == T_REGEXP) {
|
||||
|
@ -1600,7 +1600,17 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
|
|||
if (FIXNUM_P(argv[1])) flags = FIX2INT(argv[1]);
|
||||
else if (RTEST(argv[1])) flags = ONIG_OPTION_IGNORECASE;
|
||||
}
|
||||
if (argc == 3 && !NIL_P(argv[2])) {
|
||||
char *kcode = StringValuePtr(argv[2]);
|
||||
if (kcode[0] == 'n' || kcode[1] == 'N') {
|
||||
flags |= ARG_KCODE_NONE;
|
||||
}
|
||||
else {
|
||||
rb_warning("encoding option is obsolete - %s", kcode);
|
||||
}
|
||||
}
|
||||
str = argv[0];
|
||||
StringValueCStr(str);
|
||||
if (rb_reg_initialize_str(self, str, flags, err)) {
|
||||
rb_reg_raise_str(str, flags, err);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2007-10-16"
|
||||
#define RUBY_RELEASE_DATE "2007-10-17"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20071016
|
||||
#define RUBY_RELEASE_CODE 20071017
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2007
|
||||
#define RUBY_RELEASE_MONTH 10
|
||||
#define RUBY_RELEASE_DAY 16
|
||||
#define RUBY_RELEASE_DAY 17
|
||||
|
||||
#ifdef RUBY_EXTERN
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
|
|
Loading…
Add table
Reference in a new issue