summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-29 12:05:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-12-29 12:05:16 +0000
commitde3bff164c3b8405f40d2e89cf726f7e865102d1 (patch)
tree8f24b7069ab459f2829b3c986f9759111c5181e9 /ext
parente5226ea394da345a1abf7719d4e0482de89df26e (diff)
* eval.c (rb_mod_define_method): should save safe_level in the
proc object. [ruby-dev:28146] * test/drb/drbtest.rb (DRbService::self.ext_service): increase timeout limit. a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>. [ruby-dev:28132] * eval.c (ev_const_get): fixed a bug in constant reference during instance_eval. [yarv-dev:707] * eval.c (ev_const_defined): ditto. * lib/yaml.rb (YAML::add_domain_type): typo fixed. a patch from Joel VanderWerf <vjoel at path.berkeley.edu>. [ruby-talk:165285] [ruby-core:6995] * ext/digest/sha2/sha2.c (ULL): support AIX C. a patch from Kailden <kailden at gmail.com>. [ruby-core:06984] * ext/syck/rubyext.c (rb_syck_compile): avoid potential memory leak. * ext/syck/rubyext.c (syck_set_ivars): avoid potential memory leak by explicit symbol allocation. * lib/delegate.rb (Delegator::method_missing): should delegate block as well. * lib/cgi.rb (CGI::QueryExtension::MorphingBody): fix criteria to use Tempfile. A fix from Zev Blut <rubyzbibd at ubit.com>. [ruby-core:06076] * string.c: remove global functions work on $_. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/digest/sha2/sha2.c2
-rw-r--r--ext/syck/rubyext.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/ext/digest/sha2/sha2.c b/ext/digest/sha2/sha2.c
index 24a57de..41ed2df 100644
--- a/ext/digest/sha2/sha2.c
+++ b/ext/digest/sha2/sha2.c
@@ -67,7 +67,7 @@ typedef uint8_t sha2_byte; /* Exactly 1 byte */
typedef uint32_t sha2_word32; /* Exactly 4 bytes */
typedef uint64_t sha2_word64; /* Exactly 8 bytes */
-#if defined(__GNUC__) || defined(_HPUX_SOURCE)
+#if defined(__GNUC__) || defined(_HPUX_SOURCE) || defined(__IBMC__)
#define ULL(number) number##ULL
#else
#define ULL(number) (uint64_t)(number)
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 272cfd2..f75e3ca 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -115,14 +115,15 @@ rb_syck_compile(self, port)
oid = syck_parse( parser );
syck_lookup_sym( parser, oid, (char **)&sav );
- ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
+ bc = rb_str_new(0, strlen( sav->buffer ) + 3);
+ ret = RSTRING(bc)->ptr;
ret[0] = '\0';
strcat( ret, "D\n" );
strcat( ret, sav->buffer );
syck_free_parser( parser );
- bc = rb_str_new2( ret ); S_FREE( ret );
+ rb_str_resize( bc, strlen(ret) );
if ( taint ) OBJ_TAINT( bc );
return bc;
}
@@ -1042,13 +1043,13 @@ syck_set_ivars( vars, obj )
{
VALUE ivname = rb_ary_entry( vars, 0 );
char *ivn;
+ ID ivns;
StringValue( ivname );
ivn = S_ALLOC_N( char, RSTRING(ivname)->len + 2 );
- ivn[0] = '@';
- ivn[1] = '\0';
- strncat( ivn, RSTRING(ivname)->ptr, RSTRING(ivname)->len );
- rb_iv_set( obj, ivn, rb_ary_entry( vars, 1 ) );
+ snprintf(ivn, RSTRING(ivname)->len + 1, "@%s", RSTRING(ivname)->ptr);
+ ivns = rb_intern(ivn);
S_FREE( ivn );
+ rb_ivar_set( obj, ivns, rb_ary_entry( vars, 1 ) );
return Qnil;
}