OCaml 4.14.0 rebuild
[arch-packages.git] / subversion / repos / extra-x86_64 / ruby-frozen-nil.patch
blobef29bc1584a8cc473aaab43dfb5696d18ec599e4
1 commit 6c69127693e9e395c026d982f871253548037a4d
2 Author: James McCoy <jamessan@debian.org>
3 Date: Sun Nov 8 23:06:45 2015 -0500
5 Create a new Ruby Object instead of attempting to modify nil.
7 Starting in Ruby 2.2, the nil, true, and false objects are frozen. This
8 was causing test_repos.rb's test_load to fail due to calling
9 "repos.load_fs(nil)". This results in svn_swig_rb_make_stream trying to
10 attributes on nil, which isn't allowed.
12 * subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c:
13 (svn_swig_rb_make_stream): Create a new Object if the given io is nil.
14 Also call svn_swig_rb_get_pool in order to deduplicate some
15 pool-handling code.
17 diff --git a/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c b/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
18 index a25ec5a..2210853 100644
19 --- a/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
20 +++ b/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
21 @@ -3230,14 +3230,16 @@ svn_swig_rb_make_stream(VALUE io)
22 stream_p = &stream;
23 r2c_swig_type2(io, "svn_stream_t *", (void **)stream_p);
24 } else {
25 + if (NIL_P(io)) {
26 + io = rb_class_new_instance(0, NULL, rb_cObject);
27 + }
28 VALUE rb_pool = rb_pool_new(Qnil);
29 - apr_pool_wrapper_t *pool_wrapper;
30 - apr_pool_wrapper_t **pool_wrapper_p;
31 + apr_pool_t *pool;
33 + svn_swig_rb_get_pool(0, NULL, io, &rb_pool, &pool);
35 rb_set_pool(io, rb_pool);
36 - pool_wrapper_p = &pool_wrapper;
37 - r2c_swig_type2(rb_pool, "apr_pool_wrapper_t *", (void **)pool_wrapper_p);
38 - stream = svn_stream_create((void *)io, pool_wrapper->pool);
39 + stream = svn_stream_create((void *)io, pool);
40 svn_stream_set_read2(stream, NULL /* only full read support */,
41 read_handler_rbio);
42 svn_stream_set_write(stream, write_handler_rbio);