Commit graph

707 commits

Author SHA1 Message Date
knu
14ddf6c9f0 * test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_gc): Fix
a bogus test that would have never passed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@37223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 08:55:15 +00:00
knu
2fa4652028 * test/-ext-/test_threadswitch_hook.rb
(Test_ThreadSwitch#test_threadswitch_init): This test does not
  pass because the hook method actually calls rb_add_event_hook()
  which does not emit a warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@37221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 08:55:11 +00:00
knu
2c791e967a Merge r37148 from ruby_1_8_7.
* error.c (name_err_to_s): we need not infect msg.

* test/ruby/test_exception.rb (TestException#test_exception_to_s_should_not_propagate_untrustedness): test for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@37220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 08:55:07 +00:00
nobu
383ad6740e merge revision(s) 34908:
* lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
	  YAML serialization problem for Exception.
	  Exception#initialize doesn't use visible instance variable for
	  the exception message, so call the method with the message.
	  patched by Jingwen Owen Ou <jingweno AT gmail.com>.
	  http://github.com/ruby/ruby/pull/41

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@34919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:03:37 +00:00
nahi
0dea8a71c9 Backport r34482 from trunk. See #5353
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@34485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-08 05:57:18 +00:00
knu
05a579c9ec Forward port r34151 from ruby_1_8_7.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@34379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-26 07:10:03 +00:00
nobu
2102e6443a * string.c (rb_str_partition, rb_str_rpartition)
(rb_str_start_with, rb_str_end_with): preserve the last match
  data.  [ruby-core:39671] [Bug #5351]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@33527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-26 07:05:42 +00:00
knu
d040bf7593 Backport r23730; fixes #2462.
* numeric.c (flo_cmp): Infinity is greater than any bignum
  number.  [ruby-dev:38672]

* bignum.c (rb_big_cmp): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 08:53:08 +00:00
nobu
f029920531 * array.c (ary_reject_bang): should not remove elements which are
not yielded.  [Bug #2545]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-03 04:44:53 +00:00
nobu
31e6b1e822 * array.c (rb_ary_reject_bang, rb_ary_delete_if): rejected
elements should be removed.  fixed [Bug #2545]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-01 22:17:46 +00:00
nahi
9cb6f5d199 * test/test_securerandom.rb: Add testcase. This testcase does NOT aim
to test cryptographically strongness and randomness.  It includes
  the test for PID recycle issue of OpenSSL described in #4579 but
  it's disabled by default.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@32124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 13:56:15 +00:00
knu
408b181d2c * lib/uri/generic.rb (#route_from_path): Fix a bug where
URI('http://h/b/').route_to('http://h/b') wrongly returned './'
  (should be '../b'). [Bug #4476]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 12:49:34 +00:00
usa
40397db9da backported r31286 from trunk
* numeric.c (ruby_float_step): wrong loop condition.
  fixes [ruby-core:35753], reported by Joey Zhou.

* test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
  test above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-18 01:12:36 +00:00
shyouhei
fca16b0c57 * error.c (exc_to_s): untainted strings can be tainted via
Exception#to_s, which enables attackers to overwrite sane strings.
  Reported by: Yusuke Endoh <mame at tsg.ne.jp>.

* error.c (name_err_to_s): ditto.

* test/ruby/test_exception.rb (TestException::test_to_s_taintness_propagation):
  Test for it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-18 11:05:02 +00:00
shyouhei
5859f1497e merge revision(s) 27388:27390:
* lib/resolv.rb (Resolv::IPv4::Regex): make it only accept 0 to 255.
	  [ruby-core:29501]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 03:12:12 +00:00
nahi
36f1477f3f * Backported the fix at
Mon Sep 13 09:23:58 2010  NARUSE, Yui  <naruse@ruby-lang.org>

        * ext/openssl/ossl_bn.c (ossl_bn_is_prime): fix comparison
          with rb_scan_args. Before this fix, OpenSSL::BN#prime?
          is fully broken.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 16:07:06 +00:00
nahi
e4906ffa48 Make test-all run. require_relative is from 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 16:05:52 +00:00
nahi
cb0ea9ddfd * Backported the fix at
Mon Oct  4 09:30:42 2010  NARUSE, Yui  <naruse@ruby-lang.org>

        * ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
          accepts only Strings, so call Integer#to_s(16).
          16 is for an optimization. [ruby-dev:42336]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 15:21:52 +00:00
nobu
7bb94fa3f5 * lib/mkmf.rb (check_sizeof): should return integer always.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@30068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-03 10:48:12 +00:00
knu
abe08c7810 * array.c (rb_ary_sort_by_bang): Add Array#sort_by!.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-17 09:29:49 +00:00
knu
598566fce3 * ext/digest/digest.c (rb_digest_class_init): Define
Digest::Class.new(). [Feature #3954]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31 16:04:19 +00:00
nobu
b5dde87123 * lib/rdoc/ri/ri_paths.rb (RI::Paths): use RbConfig instead of
obsolete and deprecated Config.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-01 07:54:26 +00:00
nobu
449e5c6a5e * ext/stringio/stringio.c (Init_stringio): added readpartial,
read_nonblock and write_nonblock aliases.  [ruby-core:27024]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-24 16:17:58 +00:00
nobu
f5cbe886b6 * eval.c (rb_add_threadswitch_hook): wrapper for unofficial APIs
in Mac OS X port.  the use of them is strongly discouraged.

	* eval.c (rb_remove_threadswitch_hook): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-23 18:00:46 +00:00
nahi
8d76496094 * ext/openssl/ossl_asn1.c (obj_to_asn1bool): fixed ASN1::Boolean
encoding issue for OpenSSL 1.0.0 compatibility.
          ASN1::Boolean.new(false).to_der wrongly generated "\1\1\377" which
          means 'true'.

          ASN1_TYPE_set of OpenSSL <= 0.9.8 treats value 0x100 as 'false' but
          OpenSSL >= 1.0.0 treats it as 'true'.  ruby-ossl was using 0x100 for
          'false' for backward compatibility.  Just use 0x0 for the case
          OpenSSL >= OpenSSL 0.9.7.

        * test/openssl/test_asn1.rb: test added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-23 03:06:30 +00:00
nahi
a62f73e093 * test/openssl/{test_x509cert.rb,test_ssl.rb,test_x509req.rb}: added
tests for SSL and wrong signature algorithm combination. 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-19 14:00:47 +00:00
nahi
71da8cbd5a * test/openssl/test_ssl.rb: removed unnecessary free port scanning of
test_ssl.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-19 08:14:48 +00:00
nahi
bb495c888f * ext/openssl/lib/openssl/config.rb, test/openssl/test_config.rb:
cosmetic changes for 1.9 compatibility; let it run on 1.9 as-is.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@29045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-19 08:00:13 +00:00
nobu
c03e220cf3 * file.c (file_expand_path): home directory must be absolute.
[ruby-core:31537]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29 23:51:53 +00:00
nobu
f2c87d5395 * file.c (file_expand_path): should check if could find user.
[ruby-core:31538]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29 23:33:21 +00:00
nobu
209cf1351b * util.c (ruby_add_suffix): fixed a bug returning uninitialized
value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29 22:59:54 +00:00
nahi
879ab2c2ee * ext/openssl/ossl_config.c, ext/openssl/lib/openssl/config.rb,
ext/openssl/lib/openssl.rb: reimplement OpenSSL::Config in Ruby. Now
          it should work on windows.

        * test/openssl/test_config.rb: added tests for OpenSSL::Config#dup.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13 12:49:56 +00:00
nahi
b774137633 * ext/openssl/ossl_config.c (ossl_config_copy): wrongly updating the
given object with uninitialized CONF data.  now 
          OpenSSL::Config#clone works as expected; cloning the config instead of
          SEGV or empty definition.

        * test/openssl/test_config.rb: added tests for Config#clone.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-12 13:32:49 +00:00
nahi
bdfcfd4791 * test/openssl/test_config.rb: more tests for parse_config formats.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-09 14:33:15 +00:00
nahi
5c68afdaab * test/openssl/test_config.rb: test_s_parse_format added in the
prvious commit fails for all OpenSSL implementations.  fixed the 
          test. tested against OpenSSL 1.0.0a and OpenSSL 0.9.8o.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 14:16:07 +00:00
nahi
c345797525 * test/openssl/test_config.rb: added tests for class methods,
constants and parse format of OpenSSL itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 13:55:02 +00:00
nahi
6b225d142d * test/openssl/test_config.c: added tests for all Config methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 04:44:58 +00:00
knu
7faf411f93 * ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): new workaround for
getaddrinfo problem on Mac OS X Snow Leopard.  [ruby-core:29427]
  patch by Wataru Kimura.  [ruby-core:30842] [Backport #3474]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-25 14:41:59 +00:00
nobu
de2a1b33c2 * test/optparse/test_summary.rb: fixed superclass so that it run
solely.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22 12:33:33 +00:00
mrkn
c0ec23d127 * bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f): A negative Bignum out of Float range should be converted to -Infinity. [ruby-core:30492] [Bug #3362]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-15 01:47:19 +00:00
seki
36c13a6d55 raise DRbConnError instead of ArgumentError if too many arguments.
[ruby-dev:41481]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-14 09:34:43 +00:00
naruse
9f9388e57e * regexp.c (re_compile_pattern): allow zero times match for
non-greedy range repeatation. [ruby-core:30613]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-07 06:14:46 +00:00
akr
7e56b2d2bf backport pack and unpack tests from Ruby 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10 14:54:56 +00:00
nobu
8489a0199f * regex.c (read_special): get rid of overrun.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10 06:48:30 +00:00
nobu
cccc8cbd45 * ext/bigdecimal/bigdecimal.c (VpAlloc): ensure buf does not get
collected.  based on a patch masaya tarui at [ruby-dev:41213].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 02:07:43 +00:00
akr
3ed2a5fee7 don't sleep indefinitely. collect the zombie.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-07 15:07:11 +00:00
nobu
33af94015b * ext/syck/emitter.c (syck_scan_scalar): set SCAN_WHITEEDGE flag
when scalar begins with newline.  patches from Dave B <daz AT
  d10.karoo.co.uk> at [ruby-core:23019] and caleb clausen at
  [ruby-core:25851].  [ruby-core:23006][ruby-core:29925]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02 23:15:08 +00:00
shugo
1b9012049d * lib/net/imap (encode_utf7): encode & properly. Thanks, Kengo
Matsuyama.  [ruby-dev:38063]  backported from trunk.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-25 12:42:10 +00:00
nobu
46bafdd84d * file.c (rb_file_s_extname): skip last directory separators.
[ruby-core:29627]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 15:43:05 +00:00
nobu
3dea38333c * eval.c (search_required): expand home relative path first.
[ruby-core:29610]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@27398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 10:13:14 +00:00