summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-20 23:29:49 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-20 23:29:49 +0000
commitccdba542d3f765895a23f32fd2905add935b7a19 (patch)
tree111fa0e3b28c14ec1c23132a92ff5052250fab0c
parentfeb78840c86a4cb91a61d368cebd54af728039ec (diff)
Import bigdecimal-1.4.0.pre.20181220a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181214a..v1.4.0.pre.20181220a git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/bigdecimal/bigdecimal.c2
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec2
-rw-r--r--ext/bigdecimal/depend2
-rw-r--r--ext/bigdecimal/extconf.rb7
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb1
5 files changed, 11 insertions, 3 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 64d7f200789..052fdc57b98 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -4271,7 +4271,7 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
while (ISSPACE(szVal[j])) ++j;
/* Invalid character */
- if (szVal[j]) {
+ if (szVal[j] && strict_p) {
goto invalid_value;
}
}
diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec
index 2475de78815..c20dada329c 100644
--- a/ext/bigdecimal/bigdecimal.gemspec
+++ b/ext/bigdecimal/bigdecimal.gemspec
@@ -1,6 +1,6 @@
# coding: utf-8
-bigdecimal_version = '1.4.0.pre.20181214a'
+bigdecimal_version = '1.4.0.pre.20181220a'
Gem::Specification.new do |s|
s.name = "bigdecimal"
diff --git a/ext/bigdecimal/depend b/ext/bigdecimal/depend
index 4c797d79661..943bd6c38c6 100644
--- a/ext/bigdecimal/depend
+++ b/ext/bigdecimal/depend
@@ -1,5 +1,5 @@
extconf.h: $(srcdir)/$(GEMSPEC)
-Makefile: $(srcdir)/lib/bigdecimal.rb
+Makefile: $(BIGDECIMAL_RB)
# AUTOGENERATED DEPENDENCIES START
bigdecimal.o: $(RUBY_EXTCONF_H)
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index 2ae5e1b720e..a6a36304cc7 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -28,6 +28,13 @@ have_func("rb_rational_den", "ruby.h")
have_func("rb_array_const_ptr", "ruby.h")
have_func("rb_sym2str", "ruby.h")
+if File.file?(File.expand_path('../lib/bigdecimal.rb', __FILE__))
+ bigdecimal_rb = "$(srcdir)/lib/bigdecimal.rb"
+else
+ bigdecimal_rb = "$(srcdir)/../../lib/bigdecimal.rb"
+end
+
create_makefile('bigdecimal') {|mf|
mf << "GEMSPEC = #{gemspec_name}\n"
+ mf << "BIGDECIMAL_RB = #{bigdecimal_rb}\n"
}
diff --git a/test/bigdecimal/test_bigdecimal_util.rb b/test/bigdecimal/test_bigdecimal_util.rb
index 04c8eb2b46f..bb9ed831857 100644
--- a/test/bigdecimal/test_bigdecimal_util.rb
+++ b/test/bigdecimal/test_bigdecimal_util.rb
@@ -74,6 +74,7 @@ class TestBigDecimalUtil < Test::Unit::TestCase
assert_equal(BigDecimal('0.1'), "0.1_e10".to_d)
assert_equal(BigDecimal('0.1'), "0.1e_10".to_d)
assert_equal(BigDecimal('1'), "0.1e1__0".to_d)
+ assert_equal(BigDecimal('1.2'), "1.2.3".to_d)
assert("2.5".to_d.frozen?)
end