Commit 933f8013 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge branch 'master' of github.com:mruby/mruby

parents 9a92b40a 55a43c78
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
#ifndef MRUBY_COMPILE_H #ifndef MRUBY_COMPILE_H
#define MRUBY_COMPILE_H 1 #define MRUBY_COMPILE_H
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
#ifndef MRUBY_DATA_H #ifndef MRUBY_DATA_H
#define MRUBY_DATA_H 1 #define MRUBY_DATA_H
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
......
...@@ -115,15 +115,15 @@ mrb_random_init(mrb_state *mrb, mrb_value self) ...@@ -115,15 +115,15 @@ mrb_random_init(mrb_state *mrb, mrb_value self)
mrb_value seed; mrb_value seed;
mt_state *t; mt_state *t;
DATA_TYPE(self) = &mt_state_type;
DATA_PTR(self) = NULL;
/* avoid memory leaks */ /* avoid memory leaks */
t = (mt_state*)DATA_PTR(self); t = (mt_state*)DATA_PTR(self);
if (t) { if (t) {
mrb_free(mrb, t); mrb_free(mrb, t);
} }
DATA_TYPE(self) = &mt_state_type;
DATA_PTR(self) = NULL;
t = (mt_state *)mrb_malloc(mrb, sizeof(mt_state)); t = (mt_state *)mrb_malloc(mrb, sizeof(mt_state));
t->mti = N + 1; t->mti = N + 1;
......
...@@ -43,7 +43,11 @@ module MRuby ...@@ -43,7 +43,11 @@ module MRuby
if params[:github] if params[:github]
params[:git] = "https://github.com/#{params[:github]}.git" params[:git] = "https://github.com/#{params[:github]}.git"
elsif params[:bitbucket] elsif params[:bitbucket]
params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git" if params[:method] == "ssh"
params[:git] = "git@bitbucket.org:#{params[:bitbucket]}.git"
else
params[:git] = "https://bitbucket.org/#{params[:bitbucket]}.git"
end
end end
if params[:core] if params[:core]
......
...@@ -36,6 +36,10 @@ end ...@@ -36,6 +36,10 @@ end
assert('String#*', '15.2.10.5.5') do assert('String#*', '15.2.10.5.5') do
assert_equal 'aaaaa', 'a' * 5 assert_equal 'aaaaa', 'a' * 5
assert_equal '', 'a' * 0
assert_raise(ArgumentError) do
'a' * -1
end
end end
assert('String#[]', '15.2.10.5.6') do assert('String#[]', '15.2.10.5.6') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment