Commit graph

3969 commits

Author SHA1 Message Date
usa
583d9edebb merge revision(s) 37406: [Backport #7176]
* ext/bigdecimal/bigdecimal.c (BigDecimal_add),
	  test/bigdecimal/test_bigdecimal.rb:
	  need to specify precision for converting Rational and Float.
	  [ruby-core:48045] [Bug #7176]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-08 05:09:39 +00:00
usa
0e6dcc7ab2 merge revision(s) 32826,34732: [Backport #6681]
* file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
  (rb_enc_path_last_separator, rb_enc_path_end)
  (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
  path handling functions.

* file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
  (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
  (rb_file_join): should respect the encodings of arguments than
  file system encoding.  [ruby-dev:45145] [Bug #5919]

* dir.c (check_dirname, ruby_glob0): ditto.

* ext/pathname/pathname.c (path_sub_ext): ditto.

* util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
  [Bug #5153] [ruby-core:38736]

* io.c (argf_next_argv): remove the call of above function.

* ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
  extension module because this is only for testsing ruby_add_suffix().

* LEGAL: remove the mention about a part of util.c, because now we
  removed the part.

* io.c (argf_next_argv): now the new filename is not guranteed to
  use, so should check the return value of rename(2).

* test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
  now we expect same result with other platforms on no_safe_rename
  platforms (=Windows).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 03:01:41 +00:00
usa
c5b7d11e59 merge revision(s) 35488:
* ext/-test-/win32/dln/extconf.rb: remove test DLL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 00:52:58 +00:00
naruse
01865d5bc6 merge revision(s) 35485: [Backport #7013]
* ext/dl/cfunc.c (rb_dlcfunc_call): should convert a Bignum value to
	  unsigned long long on Win64.
	  [ruby-core:44636][Bug #6364] reported by raylinn@gmail.com (ray linn)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-21 10:53:50 +00:00
naruse
807c13cc61 merge revision(s) 35496:
* ext/zlib/extconf.rb: detect z_crc_t type which will be defined
	  since zlib-1.2.7.

	* ext/zlib/zlib.c (rb_zlib_crc_table): use z_crc_t if available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-09 14:01:53 +00:00
kosaki
390bbfed58 merge revision(s) 35687:35691:
* ext/zlib/extconf.rb: Use an exception instaed of bare puts.

	* ext/psych/extconf.rb: Use an exception instaed of bare abort.

	* ext/fiddle/extconf.rb: Use an exception instaed of bare abort.

	* ext/readline/extconf.rb: Use an exception instead of bare exit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-09 06:44:20 +00:00
kosaki
1048cf39d0 merge revision(s) 35685
* ext/extmk.rb: Show a message when extconf.rb raised an exception.
* ext/openssl/extconf.rb: Use exception raising instead of message
  and/or abort. We want to display error message to console _and_
  logging into mkmf.log.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-09 06:39:23 +00:00
tenderlove
6b3bac29fe merge revision(s) r36583, r36458, r36414, r36103, r35690, r35681, r35658, r35657, r35655, r35492: [Backport #6815]
* ext/psych/lib/psych.rb: updated to released version.

    * ext/psych/psych.gemspec: ditto

    * ext/psych/emitter.c (initialize): allow a configuration object to be
      passed to the constructor so that mutation isn't required after
      instantiation.

    * ext/psych/lib/psych/handler.rb: add configuration object

    * ext/psych/lib/psych/visitors/emitter.rb: use configuration object if
      extra configuration is present.

    * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
      are properly referenced. Patched by Joe Rafaniello via Github:
        https://github.com/tenderlove/psych/pull/69
    * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
    * test/psych/test_alias_and_anchor.rb: test for change

    * ext/psych/lib/psych.rb: bumping psych to 1.3.3
    * ext/psych/psych.gemspec: ditto

    * ext/psych/extconf.rb: Use an exception instaed of bare abort.

    * ext/psych/parser.c (transcode_string): fix encoding index names.
      Thanks markizko for reporting.

    * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string
      subclass dumping and loading.

    * test/psych/test_array.rb: pertinent tests

    * test/psych/test_string.rb: ditto

    * ext/psych/lib/psych/visitors/to_ruby.rb: convert omap tagged maps to
      Psych::Omap objects rather than hashes. [Bug #6425]

    * test/psych/test_omap.rb: pertinent test.

    * ext/psych/lib/psych/visitors/yaml_tree.rb: keep a reference to
      custom coders so that GC does not impact dumped yaml reference ids.

    * ext/psych/lib/psych/json/yaml_events.rb: implicit styles should not
      be changeable for JSON events.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-07 20:50:05 +00:00
naruse
33d5c4848d merge revision(s) 36455: [Backport #6772]
* ext/curses/extconf.rb: support PDCurses.  patched by Luis Lavena.
	  [ruby-core:46485] [Feature #6735]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-29 02:23:21 +00:00
naruse
24d1ff57c7 merge revision(s) 36281:
* ext/dl/cfunc.c (rb_dlcfunc_call): also needed the workaround for VC8
	  for x64.  [ruby-dev:45875] [Bug #6676]
	  reported by aves_ramphastos (Seigo Ishigane)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-04 10:36:28 +00:00
naruse
4e273f7676 Revert r36279; it breaks C API compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03 15:38:58 +00:00
naruse
42c34dd375 merge revision(s) 34372:
* file.c (rb_enc_path_next, rb_enc_path_skip_prefix)
	  (rb_enc_path_last_separator, rb_enc_path_end)
	  (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
	  path handling functions.

	* file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
	  (rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
	  (rb_file_join): should respect the encodings of arguments than
	  file system encoding.  [ruby-dev:45145] [Bug #5919]

	* dir.c (check_dirname, ruby_glob0): ditto.

	* ext/pathname/pathname.c (path_sub_ext): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03 02:44:36 +00:00
naruse
b3e306a5f4 merge revision(s) 34552: [Bug #6516]
* ext/zlib/zlib.c (do_inflate):  Inflate more data if buffered data
	  exists.  Allows Zlib::Inflate#set_dictionary to work.
	  [ruby-trunk - Bug #5929]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-30 08:21:16 +00:00
naruse
2b8e9ece0f merge revision(s) 35595: [Backport #6446]
* include/ruby/win32.h (FD_SET): change function to macro.
	  To avoid buffer overflow when smaller FD_SETSISE is used in ext
	  libraries.

	* win32/win32.c (rb_w32_fdset): this function is not used anymore.
	  But we leave this for compatibility.

	* win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
	  FD_SETSISE is used in ext libraries. Dereference of fd_set pointer
	  causes SEGV.

	* test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
	  above.

	* ext/-test-/win32/fd_setsize/depend: ditto.

	* ext/-test-/win32/fd_setsize/extconf.rb: ditto.

	* ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.
	  [ruby-core:44588] [Bug #6352]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-25 01:40:58 +00:00
knu
d5ba54a5e0 merge revision(s) 35737:
* ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
	  module before calling rb_class2name().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-21 07:24:34 +00:00
tenderlove
17325a1d33 * ext/digest/md5/extconf.rb: use pkg_config for openssl so that
customized ssl paths are used for linking.  Backports fixes for
  [ruby-core:44755].
* ext/digest/rmd160/extconf.rb: ditto
* ext/digest/sha1/extconf.rb: ditto
* ext/digest/sha2/extconf.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-15 16:10:46 +00:00
nobu
67166228c6 * ext/bigdecimal/bigdecimal.c (PUSH): to prevent VALUE from GC,
must not cast it to unsigned long, which may be shorter than
	  VALUE, and the result can be mere garbage.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-11 05:09:58 +00:00
naruse
f4be1257a4 merge revision(s) 35555:
* ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
	  they are used. [ruby-core:44900] [Bug #6406]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 02:09:33 +00:00
nobu
b51081308b merge revision(s) 35395:
* ext/-test-/win32/dln/extconf.rb: need import library for ordinal
	  entry even on mingw.  [ruby-core:44441][Bug #6320]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-19 03:55:38 +00:00
nobu
5468593e14 merge revision(s) 35368:
* ext/-test-/win32/dln/extconf.rb: fix for mingw.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 14:22:01 +00:00
nobu
a940590a43 merge revision(s) 35354,35356,35357,35361:
* dln.c (rb_w32_check_imported): skip ordinal entries.  based on a
	  patch by phasis68 (Heesob Park) at [ruby-core:44381].
	  [ruby-core:44371][Bug #6303]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17 05:27:25 +00:00
naruse
34c1a1691b Merge eacb6564c05ff7428bcbb3c34f72655b1b5d6ca3.
[Backport #6304]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16 11:15:31 +00:00
nobu
ffc3114c1a * ext/-test-/add_suffix/bug.c (ruby_add_suffix): no static
declaration.  [ruby-core:44277][Bug #6279]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 07:22:19 +00:00
tenderlove
a9649469b5 merge revision(s) 35245,35248:
* ext/psych/lib/psych.rb: bumping up psych version to match release.
    * ext/psych/psych.gemspec: ditto

    * ext/psych/parser.c: fall back to any encoding if the external
      encoding is wrong.  [ruby-core:44163]
    * test/psych/test_encoding.rb: fix test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07 21:31:43 +00:00
nobu
a5064ff120 * ext/-test-/add_suffix/bug.c: make all functions in util.c static
to get rid of multiple definitions.  reported at
  https://trac.macports.org/ticket/33814


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-04 02:32:11 +00:00
emboss
5acdbe9029 * ext/openssl/ossl_x509cert.c: Fix doc typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 03:12:47 +00:00
naruse
7d8e27a6a4 merge revision(s) 35162,35167: [Backport #6220]
* test/openssl/test_x509cert.rb: Exclude test that fails when issuing
	  a certificate with RSA signature and DSS1 digest for earlier
	  OpenSSL versions when used in conjunction with OpenSSL 1.0.1.
	  Thanks, Vit Ondruch, for reporting the issue.
	  [ruby-core:42949][Bug #6089]

	* ext/openssl/ossl_pkcs7.c: fix crash when parsing garbage data.

	* test/openssl/test_pkcs7.rb: assert correct behavior for it.
	  Thanks to Matt Venables for reporting the issue.
	  [ruby-core:43250][Bug #6134]

	* test/openssl/test_x509cert.rb: exclude test that fails when issuing


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30 05:17:45 +00:00
naruse
d66248a7cd merge revision(s) 35002: [Backport #6135]
* ext/date/date_core.c (datetime_s_now): [ruby-core:43256].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30 05:15:10 +00:00
tenderlove
7d984d76ba merge revision(s) 32578,33401,33403,33404,33531,33655,33679,33809,33900,33965,34067,34069,34087,34328,34330,34527,34772,34783,34839,34914,34953,34954,35153: [Backport #6212]
* ext/psych/lib/psych.rb: updating version to match gem
	* ext/psych/psych.gemspec: ditto
	* ext/psych/lib/psych/visitors/to_ruby.rb: fixing deprecation warning

	* ext/psych/lib/psych.rb: define a new BadAlias error class.

	* ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
	  deserializing an alias that does not exist.

	* test/psych/test_merge_keys.rb: corresponding test.

	* ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
	  the first document has been parsed.

	* test/psych/test_stream.rb: pertinent tests.

	* ext/psych/lib/psych.rb (parse_stream, load_stream): if a block is
	  given, documents will be yielded to the block as they are parsed.
	  [ruby-core:42404] [Bug #5978]

	* ext/psych/lib/psych/handlers/document_stream.rb: add a handler that
	  yields documents as they are parsed

	* test/psych/test_stream.rb: corresponding tests.

	* ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
	  in order to stop method pollution.

	* ext/psych/lib/psych.rb: default open YAML files with utf8 external
	  encoding. [ruby-core:42967]
	* test/psych/test_tainted.rb: ditto

	* ext/psych/parser.c: prevent a memory leak by protecting calls to
	  handler callbacks.
	* test/psych/test_parser.rb: test to demonstrate leak.

	* ext/psych/parser.c: set parser encoding based on the YAML input
	  rather than user configuration.
	* test/psych/test_encoding.rb: corresponding tests.
	* test/psych/test_parser.rb: ditto
	* test/psych/test_tainted.rb: ditto

	* ext/psych/parser.c: removed external encoding setter, allow parser
	  to be reused.
	* ext/psych/lib/psych/parser.rb: added external encoding setter.
	* test/psych/test_parser.rb: test parser reuse

	* ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
	  subclasses of String with ivars
	* ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
	  subclasses of String with ivars
	* test/psych/test_string.rb: corresponding tests

	* ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
	  subclasses with ivars.
	* ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
	  array subclasses with ivars.
	* test/psych/test_array.rb: corresponding tests

	* ext/psych/emitter.c: fixing clang warnings. Thanks Joey!

	* ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
	  from YAML.
	* ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
	  to YAML.
	* test/psych/test_numeric.rb: tests for BigDecimal serialization

	* ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
	  should be treated as strings and not dates.

	* test/psych/test_scalar_scanner.rb: corresponding tests.

	* ext/psych/lib/psych.rb (module Psych): parse and load methods take
	  an optional file name that is used when raising Psych::SyntaxError
	  exceptions
	* ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
	  names and handle nil file names in the exception message
	* test/psych/test_exception.rb (module Psych): Tests for changes.

	* ext/psych/parser.c (parse): parse method can take an option file
	  name for use in exception messages.
	* test/psych/test_parser.rb: corresponding tests.

	* ext/psych/lib/psych.rb: remove autoload from psych
	* ext/psych/lib/psych/json.rb: ditto

	* ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
	  rationals, etc with reference ids.
	* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
	* ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
	  rationals, etc with reference ids.
	* test/psych/test_object_references.rb: corresponding tests

	* ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
	  like base 60 numbers are serialized as quoted strings.
	* test/psych/test_string.rb: test for change.

	* ext/psych/parser.c: remove unused variable.

	* ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
	  message attributes during parse failure.
	* ext/psych/parser.c: Update parser to raise exception with correct
	  values.
	* test/psych/test_exception.rb: corresponding tests.

	* ext/psych/parser.c (parse): Use context_mark for indicating error
	  line and column.

	* ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
	  since postfix rescue cannot receive the exception class. Thanks
	  nagachika!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-29 01:25:11 +00:00
nobu
4257124d00 merge revision(s) 34917:
* ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOK
	  bits too.

	* ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits.
	  [ruby-dev:45309] [Bug #6116]

	* ext/io/console/console.c (console_raw): fix rdoc.

	* ext/io/console/console.c (console_set_echo): mentioned about
	  platform dependency.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:48:34 +00:00
nobu
9f8a7d00b5 merge revision(s) 33786:
* ext/io/console/console.c (console_raw, console_set_raw)
	  (console_getch): optional parameters.  [EXPERIMENTAL]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:40:26 +00:00
nobu
7a208f4b18 merge revision(s) 33785:
* ext/io/console/console.c (console_cooked, console_set_cooked):
	  new methods to reset cooked mode.  [EXPERIMENTAL]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:39:42 +00:00
nobu
c7495f996d merge revision(s) 34376:
* ext/io/console/console.c (io_getch): default delegating method
	  for StringIO.  https://github.com/nobu/io-console/issues/4

	* ext/stringio/stringio.c: moved some methods to hidden modules.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:32:28 +00:00
nobu
9ca160c168 merge revision(s) 33172,33968:
* ext/io/console/console.c (console_set_winsize): remove
  unused variable.
	* io.c (Init_IO):  Mention io/console methods.  [Ruby 1.9 - Bug #5602]

	* ext/io/console/console.c:  Mention that io/console must be required
	  similar to lib/time.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:31:12 +00:00
nobu
0c493edcce merge revision(s) 32747:
* remove unused variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 03:27:16 +00:00
nobu
0496299e15 merge revision(s) 34908:
* ext/syck/lib/syck/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_9_3@34918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 02:43:21 +00:00
nobu
e9ef9bd0db merge revision(s) 34829:
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
	  can be overridden, so should not make an assumption on the type
	  of results.  [ruby-core:42969][Bug #6093]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27 08:25:46 +00:00
naruse
4103e718f8 merge revision(s) 33326:
warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 09:27:51 +00:00
naruse
c32308780c merge revision(s) 34644:
* ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
	  Berkeley DB library.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 01:16:19 +00:00
naruse
a81c766340 Fix debug line of ext/dbm/extconf.rb in r34641. [Backport #6021]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 00:38:04 +00:00
naruse
de889a30d2 * ext/dbm/extconf.rb: merge trunk's ext/dbm/extconf.rb and
related functions of lib/mkmf.rb. [Backport #6021]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-16 08:56:21 +00:00
naruse
a4debd6ae2 merge revision(s) 34626,34627:
* ext/fiddle/closure.c (callback): same as r34506.

	* ext/fiddle/closure.c (callback): deal with unsinged integers.
	  [ruby-core:42458][Bug #5991][Bug #6022]

	* ext/fiddle/conversions.c (value_to_generic, generic_to_value):
	  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 21:31:16 +00:00
naruse
35c546104b merge revision(s) 32712,32718,32719: [Backport #6014]
* ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
	  workaround to mark wrapped object.  this is not a true fix,
	  because [Bug #4929] is caused by the interface design of DL.

	* ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.

	* ext/dl/cptr.c (rb_dlptr_s_to_ptr): fix wrapping condition.

	* ext/dl/cptr.c (rb_dlptr_s_to_ptr): use rb_check_funcall.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14 20:09:27 +00:00
naruse
0c8cfb4eab merge revision(s) 32720: [Backport #6015]
* ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
	  dereference.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14 20:05:04 +00:00
naruse
6d0f11de6a merge revision(s) 33946:
* ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
	  1st, to change the mode of an IO is very sensitive problem, so
	  the maintainer of this library should judge it.
	  2nd, usually Zlib::GzReader.new is not called directly.  #initialize
	  is called via .open, and in the method the I/O is opened in binary
	  mode, so there is no problem without changing the mode in #initialize.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10 18:37:45 +00:00
naruse
773b80bf36 merge revision(s) 33937: [Backport #5704]
* ext/zlib/zlib.c (rb_gzreader_initialize): use binary mode by default
	  under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706]
	  [Feature #5562]

	* include/ruby/encoding.h (void rb_econv_binmode): define NEWLINE
	  decorator.

	* io.c (rb_cloexec_fcntl_dupfd): Introduce NEED_READCONV and
	  NEED_WRITECONV to replace universal newline decorator by CRLF only
	  when required to improve file reading and writing under Windows.
	  Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]

	* io.c (do_writeconv): adjust binary mode if required.

	* io.c (read_all, appendline, swallow, rb_io_getline_1): ditto.

	* io.c (io_getc, rb_io_each_codepoint, rb_io_ungetc): ditto.

	* io.c (rb_io_binmode, rb_io_ascii8bit_binmode): ditto.

	* io.c (rb_io_extract_modeenc, rb_sysopen): ditto.

	* io.c (pipe_open, prep_stdio, io_encoding_set): ditto.

	* io.c (rb_io_s_pipe, copy_stream_body): ditto.

	* test/ruby/test_io_m17n.rb (EOT): add test for pipe and stdin in
	  binary mode.

	* win32/win32.c (init_stdhandle): remove O_BINARY from stdhandle
	  initialization.

	* win32/win32.c (rb_w32_write): use FTEXT mode accordingly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10 18:24:25 +00:00
naruse
2c5d6bae4d merge revision(s) 33485:
* lib/openssl/buffering.rb: Force multi-byte strings to be treated as
	  binary data.

	* test/openssl/test_ssl.rb: Add test for it.
	Thanks to Niklas Baumstark for reporting the issue!
	[Ruby 1.9 - Bug #5233] [ruby-core:39120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10 17:27:22 +00:00
emboss
0234bcfd19 * backport r34482 from trunk
* ext/openssl/ossl_ssl.c: Add SSL constants and allow to unset SSL
  option to prevent BEAST attack. See [Bug #5353].

  In OpenSSL, OP_DONT_INSERT_EMPTY_FRAGMENTS is used to prevent
  TLS-CBC-IV vulunerability described at
  http://www.openssl.org/~bodo/tls-cbc.txt
  It's known issue of TLSv1/SSLv3 but it attracts lots of attention
  these days as BEAST attack. (CVE-2011-3389)

  Until now ossl sets OP_ALL at SSLContext allocation and call
  SSL_CTX_set_options at connection.  SSL_CTX_set_options updates the
  value by using |= so bits set by OP_ALL cannot be unset afterwards.
  This commit changes to call SSL_CTX_set_options only 1 time for each
  SSLContext. It sets the specified value if SSLContext#options= are
  called and sets OP_ALL if not.

  To help users to unset bits in OP_ALL, this commit also adds several
  constant to SSL such as
  OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.  These constants were
  not exposed in Ruby because there's no way to unset bits in OP_ALL
  before.

  Following is an example to enable 0/n split for BEAST prevention.

    ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS

* test/openssl/test_ssl.rb: Test above option exists.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 17:04:41 +00:00
nobu
5c99e2f633 * ext/fiddle/fiddle.c (Init_fiddle): declare in modern style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 15:15:57 +00:00
naruse
b97d91dd4a merge revision(s) 34504,34506,34507,34508:
* ext/dl/lib/types.rb: Win64 support.

	* ext/fiddle/conversions.c (value_to_generic): src is not guranteed as
	  a Bignum if the type is LONG_LONG.  it may be a Fixnum if the value
	  is small.

	* ext/dl/lib/value.rb (DL::ValueUtil.{unsigned_value,signed_value}):
	  currenly pack/unpack does not accept "q!" and "Q!".

	* test/ruby/memory_status.rb (Memory::Win32): 64bit support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 07:20:53 +00:00