1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_prepare_re): initialize error message buffer.

(rb_reg_search): ditto.
  (rb_reg_check_preprocess): ditto.
  (rb_reg_new_str): ditto.
  (rb_enc_reg_new): ditto.
  (rb_reg_compile): ditto.
  (rb_reg_initialize_m): ditto.
  (rb_reg_s_union_m): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-01-14 04:51:10 +00:00
parent fcb0b1f503
commit a31e2da12c
2 changed files with 20 additions and 9 deletions

View file

@ -1,3 +1,14 @@
Mon Jan 14 13:49:26 2008 Tanaka Akira <akr@fsij.org>
* re.c (rb_reg_prepare_re): initialize error message buffer.
(rb_reg_search): ditto.
(rb_reg_check_preprocess): ditto.
(rb_reg_new_str): ditto.
(rb_enc_reg_new): ditto.
(rb_reg_compile): ditto.
(rb_reg_initialize_m): ditto.
(rb_reg_s_union_m): ditto.
Mon Jan 14 12:33:07 2008 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/markup*: Renamespace from SM::SimpleMarkup to

18
re.c
View file

@ -984,7 +984,7 @@ rb_reg_prepare_re(VALUE re, VALUE str)
}
if (need_recompile) {
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
int r;
OnigErrorInfo einfo;
regex_t *reg, *reg2;
@ -1079,7 +1079,7 @@ rb_reg_search(VALUE re, VALUE str, int pos, int reverse)
return result;
}
else {
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
onig_error_code_to_str((UChar*)err, result);
rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len, err, 0);
}
@ -1925,7 +1925,7 @@ VALUE
rb_reg_check_preprocess(VALUE str)
{
rb_encoding *fixed_enc = 0;
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
VALUE buf;
char *p, *end;
rb_encoding *enc;
@ -1967,7 +1967,7 @@ static VALUE
rb_reg_preprocess_m(VALUE klass, VALUE obj)
{
rb_encoding *fixed_enc = 0;
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
VALUE str = rb_reg_preprocess_obj(obj, &fixed_enc, err);
if (str == Qnil)
rb_raise(rb_eArgError, "%s", err);
@ -2070,7 +2070,7 @@ VALUE
rb_reg_new_str(VALUE s, int options)
{
VALUE re = rb_reg_s_alloc(rb_cRegexp);
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
if (rb_reg_initialize_str(re, s, options, err) != 0) {
rb_reg_raise_str(s, options, err);
@ -2083,7 +2083,7 @@ VALUE
rb_enc_reg_new(const char *s, long len, rb_encoding *enc, int options)
{
VALUE re = rb_reg_s_alloc(rb_cRegexp);
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
if (rb_reg_initialize(re, s, len, enc, options, err) != 0) {
rb_enc_reg_raise(s, len, enc, options, err);
@ -2102,7 +2102,7 @@ VALUE
rb_reg_compile(VALUE str, int options)
{
VALUE re = rb_reg_s_alloc(rb_cRegexp);
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
if (!str) str = rb_str_new(0,0);
if (rb_reg_initialize_str(re, str, options, err) != 0) {
@ -2426,7 +2426,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
static VALUE
rb_reg_initialize_m(int argc, VALUE *argv, VALUE self)
{
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
int flags = 0;
VALUE str;
rb_encoding *enc;
@ -2778,7 +2778,7 @@ rb_reg_s_union_m(VALUE self, VALUE args)
static VALUE
rb_reg_init_copy(VALUE copy, VALUE re)
{
onig_errmsg_buffer err;
onig_errmsg_buffer err = "";
const char *s;
long len;