Граф коммитов

1179 Коммитов

Автор SHA1 Сообщение Дата
matz 88a4961cb2 * numeric.c (num_quo): should convert its operand to Rational.
* rational.c (string_to_r_strict): should raise TypeError.

* bignum.c (Init_Bignum): should not redefine Bignum#div.
  Numeric#div will do.  [ruby-dev:34066]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 10:14:42 +00:00
akr 0ef84dcefc * io.c: IO.copy_stream implemented. [ruby-dev:33843]
* thread.c (rb_fd_select): new function.

* configure.in (sys/sendfile.h): check the header file.
  (sendfile): check the function.
  (pread): check the function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30 06:38:05 +00:00
tadf 69ad92d9ca anyway renamed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-26 12:50:21 +00:00
mame 7e6dd6142e * test/ruby/test_rand.rb: add tests to achieve over 95% test coverage
of random.c.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-25 15:56:36 +00:00
mame 43a2aaea2f * test/ruby/test_rational.rb: add tests to achieve over 90% test
coverage of rational.c.

* test/ruby/test_complex.rb: ditto for complex.c.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-25 15:30:56 +00:00
mame b6c9957058 * array.c (ary_new): fix size check. [ruby-dev:34123]
* array.c (rb_ary_take, rb_ary_drop): check negative size and use
  NUM2LONG instead of FIX2LONG.  [ruby-dev:34123]

* enum.c (enum_take, enum_drop): check negative size.

* test/ruby/test_array.rb: add tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-25 10:13:03 +00:00
tadf 6e383d9fa2 fixed. [ruby-dev:34109]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-22 17:31:08 +00:00
tadf 5723a8eeb5 improvements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-20 12:26:58 +00:00
tadf 1484d1c32a added an assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19 11:06:25 +00:00
nobu 2188bbced3 * bignum.c (rb_cstr_to_inum): treat successive underscores as
nondigit.  [ruby-dev:34089]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19 05:36:43 +00:00
mame 89afc5431b * array.c (rb_ary_take, rb_ary_take_while, rb_ary_drop,
rb_ary_drop_while): new method. [ruby-dev:34067]

* test/ruby/test_array.rb: add tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-17 13:28:46 +00:00
duerst 2e7815dd80 Sun Mar 16 18:07:07 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/trans/utf_16_32.c: bug fix (some invalid UTF-8 sequences
	  were legal)

	* test/ruby/test_transcode.rb: test for above bug



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 09:09:53 +00:00
tadf 6125552c27 both complex and rational are now builtin classes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16 00:23:43 +00:00
matz 1319ad22d8 * bootstraptest/test_struct.rb: some test moved from test to shut
warning up.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-13 16:40:33 +00:00
matz 020d4e4d38 * test/ruby/test_numeric.rb (TestNumeric::test_num2long): bit-and
should not raise RangeError.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-13 16:38:56 +00:00
akr eb5789e2ac add a test for [ruby-dev:34008].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09 10:16:20 +00:00
naruse a39feece85 * string.c (search_nonascii): Use VALUE instead of unsigned long
because VALUE can be the fastest unsigned integer type.
  On LLP64 unsigned long isn't the fastest.
* string.c (str_strlen): ditto.
* string.c (str_utf8_nth): ditto.
* string.c (count_utf8_lead_bytes_with_ulong): ditto.

* string.c (count_utf8_lead_bytes_with_word): renamed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-08 09:05:34 +00:00
akr b7d7519b18 add a test for [ruby-dev:34006].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-08 06:10:22 +00:00
akr 6f8d578b8a code duplication removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-08 05:56:03 +00:00
akr 67151cd7af update sprintf rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-07 08:31:41 +00:00
akr fe2a671fdb add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 08:04:18 +00:00
usa c1e0cb08f2 * test_sprintf.rb (test_integer): add some cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 06:48:15 +00:00
akr 7a62e3ea59 add a test for [ruby-dev:34002].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 06:21:07 +00:00
nobu 591503c0ab * sprintf.c (rb_str_format): ignore 0 flag for NaN and Inf.
[ruby-dev:33994]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 06:11:43 +00:00
akr d1cd806372 * missing/lgamma_r.c (loggamma): return 0 for 1 and 2.
* test/ruby/test_math.rb: accept errors by functions under missing/.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06 05:53:03 +00:00
naruse 98cbcf1bd7 * string.c (count_utf8_lead_bytes_with_ulong): fix shift size.
[ruby-dev:33993]

* string.c (str_utf8_nth) fix wrong counting.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05 19:34:15 +00:00
akr 579f16d985 add tests for float format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05 16:24:09 +00:00
duerst 08631278ad Web Mar 5 17:43:43 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
* transcode.c (transcode_loop): Adjusted detection of invalid
	  (ill-formed) UTF-8 sequences. Fixing potential security issue, see
	  http://www.unicode.org/versions/Unicode5.1.0/#Notable_Changes.

	* test/ruby/test_transcode.rb: Added two tests for above fix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05 08:45:51 +00:00
gotoyuzo 10a0d4b61d * lib/webrick/httpservlet/filehandler.rb: should normalize path
separators in path_info to prevent directory traversal
  attacks on DOSISH platforms.
  reported by Digital Security Research Group [DSECRG-08-026].

* lib/webrick/httpservlet/filehandler.rb: pathnames which have
  not to be published should be checked case-insensitively.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03 14:31:30 +00:00
akr 7c9e815d94 test updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03 08:54:31 +00:00
matz bbc2f80a32 * re.c (rb_reg_regsub): remove too strict encoding check.
[ruby-dev:33966]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03 08:22:18 +00:00
akr 601616d6ff add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 16:16:46 +00:00
akr 655fd2dc37 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 16:05:10 +00:00
akr 374fac7482 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 15:51:04 +00:00
nobu b4b3180bfa * object.c (rb_cstr_to_dbl): check for successive underscores.
[ruby-dev:33952]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 15:08:13 +00:00
akr 00bf4e8a84 * test/ruby/allpairs.rb: new file for all pairs method.
* test/ruby/test_m17n_comb.rb: use allpairs.rb to reduce test cases.

* test/ruby/test_sprintf_comb.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 04:12:13 +00:00
matz 840723e523 test/test_{string,sprintf}.rb: updated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 01:22:45 +00:00
matz 18e70b266f * sprintf.c (rb_str_format): "%#.0o" should keep prefix where
"%#.0x" should not.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 00:38:33 +00:00
nobu 4e6e5a4316 * test/ruby/test_bignum.rb (test_too_big_to_s): skips a test using too
large memory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 17:44:15 +00:00
nobu 4a65cba488 * bignum.c (big2str_find_n1): check integer overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 17:35:11 +00:00
matz 99de7f24f7 * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test
updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 14:57:04 +00:00
akr 21c9bd1b33 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 14:36:39 +00:00
matz fa0f42d4b9 * test/ruby/test_iterator.rb (TestIterator::test_enumerator):
adjust test for zip behavior reversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 13:44:50 +00:00
matz 2d97d3ddac * string.c (rb_str_chomp_bang): now works on UTF-16.
* string.c (tr_setup_table): negation should work on non ASCII
  compatible strings as well.

* string.c (rb_str_split_m): awk split should work on non ASCII
  compatible strings as well.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 13:33:26 +00:00
matz daa622aed0 * time.c (time_strftime): format should be ascii compatible.
* parse.y (rb_intern3): non ASCII compatible symbols.

* re.c (rb_reg_regsub): add encoding check.

* string.c (rb_str_chomp_bang): ditto.

* test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 09:19:15 +00:00
matz deff2a3e24 * string.c (rb_str_rpartition): calculation was done in byte indexing.
* test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_start_with):
  allow start_with? matching on broken strings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 06:19:21 +00:00
nobu b4be9b0bb1 * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_raise):
raise is ignored in backtrace now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 05:16:39 +00:00
naruse 2f866a3666 * test/ruby/test_time.rb (test_readers): fix typo.
(test_strftime): "UTC" is also ok for time.gmtime.strftime("%Z").

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28 18:32:17 +00:00
naruse 6f99342c92 * encoding.c (enc_find): check type of argument and convert to String
if it is StringValue. [ruby-cvs:22866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28 11:58:11 +00:00
akr 310735aa4a * process.c (rlimit_resource_type): new function.
(rlimit_resource_value): new function.
  (proc_getrlimit): use rlimit_resource_type to accept
  symbol and string as resource type.
  (proc_setrlimit): use rlimit_resource_type and rlimit_resource_value
  to accept symbol and string as resource type and values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22 16:12:32 +00:00