* st.c (st_add_direct): int is not always same with st_index_t.  some
  version of clang reports error.

* thread.c (vm_living_thread_num): ditto.
  reported by d6rkaiz (Isao Sugimoto) at [ruby-dev:47096]
  [Backport #7946]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39809,39834,39837: [Backport #8132]

	* test/win32ole/test_err_in_callback.rb
	  (TestErrInCallBack#test_err_in_callback): shouldn't create a file in
	  source directory.

	* test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use
	  relative path to get rid of "too long commandline" error.
	  the top of build directory.

	* test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup):
	  allow using different root for source and build directories.
	  this may fixes a minor problem of r39834.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39509,39511: [Backport #7961]

	* lib/rexml/document.rb: move entity_expansion_limit accessor to ...

	* lib/rexml/rexml.rb: ... here to make rexml/text independent from
	  REXML::Document. It causes circular require.

	* lib/rexml/document.rb (REXML::Document.entity_expansion_limit):
	  deprecated.

	* lib/rexml/document.rb (REXML::Document.entity_expansion_limit=):
	  deprecated.

	* lib/rexml/text.rb: add missing require "rexml/rexml" for
	  REXML.entity_expansion_limit.
	  Reported by Robert Ulejczyk. Thanks!!! [ruby-core:52895] [Bug #7961]

	* lib/rexml/document.rb: move entity_expansion_text_limit accessor to ...

	* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit):

	* lib/rexml/document.rb (REXML::Document.entity_expansion_text_limit=):
	  REXML.entity_expansion_text_limit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39495: [Backport #7954]

	* string.c (str_byte_substr): don't set coderange if it's not known.
	  [Bug #7954] [ruby-dev:47108]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39507,39508: [Backport #7963]

	* tool/mkconfig.rb: reconstruct comma separated list values.  a
	  command line to Windows batch file is splitted not only by spaces
	  and equals sign but also by commas and semicolons.
	  command line to Windows batch file is split not only by spaces
	  and equal signs but also by commas and semicolons.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 35159: [Backport #7980]

	* ext/openssl/ossl_asn1.c: raise TypeError when trying to encode nil
	  values for Primitive instances. 

	* test/openssl/test_asn1.rb: Assert consistent behavior when
	  encoding nil values: Primitives raise TypeError, Constructives
	  raise NoMethodError.
	  Fixes [ruby-core:43009][Bug #6102]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39697,39701,39716,39740,39751: [Backport #8070]

	* win32/file.c (rb_file_expand_path_internal):  Expand home directory when
	  used as second parameter (dir_string).  [ruby-core:53168] [Bug #8034]

	* test/ruby/test_file_exhaustive.rb: add test to verify.

	* win32/file.c (get_user_from_path):  add internal function that retrieves
	  username from supplied path (refactored).

	* win32/file.c (rb_file_expand_path_internal):  refactor expansion of user
	  home to use get_user_from_path and cover dir_string corner cases.
	  [ruby-core:53168] [Bug #8034]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regcomp.c (optimize_node_left, set_optimize_info_from_tree): right
  handling for look behind anchor.

* regexec.c (onig_search): ditto.
  [Backport #8076]

this patch is derived from Onigmo base tree.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39772,39773,39774,39775,39777,39779,39781,39783: [Backport #8080]

	* configure.in: check struct timeval exist or not.

	* include/ruby/missing.h (struct timeval): check HAVE_STRUCT_TIMEVAL
	  properly. and don't include sys/time.h if struct timeval exist.

	* file.c: include sys/time.h explicitly.

	* random.c: ditto.

	* thread_pthread.c: ditto.

	* time.c: ditto.

	* ext/date/date_strftime.c: ditto.

	* include/ruby/missing.h (struct timespec): include <sys/time.h>

	* include/ruby/missing.h (__syscall): moved to...

	* io.c: here. because __syscall() is only used from io.c.

	* include/ruby/missing.h: move "#include <sys/type.h>" to ....

	* include/ruby/intern.h: here. because it was introduced for
	  fixing NFDBITS issue. [ruby-core:05179].

	* thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.
	  [Bug #8080] [ruby-core:53349]

	* test/ruby/test_io.rb (TestIO#test_io_select_with_many_files):
	  test for the above.

	* include/ruby/missing.h: removed __linux__. it's unnecessary.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/missing.h: fixed merge mistake of r39985.
  [Backport #8080]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39354,39356,39382: [Backport #5014]

	* signal.c (sigsegv): avoid to use async signal unsafe functions
	  when nested sigsegv is happen.
	  [Bug #5014] [ruby-dev:44082]

	* signal.c (check_stack_overflow): extract duplicated code and get rid
	  of declaration-after-statement.  [Bug #5014]

	* signal.c (ruby_abort): fix typo in r39354 [Bug #5014]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 37743: [Backport #7379]

	* win32/win32.c (rb_w32_read): Windows 8 fixed one of a bug of console
	  API.
	  based on the patch by Heesob Park at [ruby-core:49479] [Bug #7379]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 33365: [Backport #8106]

	* test/ruby/test_bignum.rb (TestBignum#test_interrupt): fix for
  faster CPU.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 36432: [Backport #6734]

	* configure.in (EXTDLDFLAGS): split options for each extension
	  libraries, and unused in ruby.pc.  [Bug #6734]

	* lib/mkmf.rb (MakeMakefile#configuration): add EXTDLDFLAGS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39967: [Backport #8194]

	* time.c (num_exact): use to_r method only if to_int method is
	  available.
	  [ruby-core:53764] [Bug #8173] reported by Hiro Asari.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 40015: [Backport #8196]

	doumentation by @toolmantim [GH fixes #270]

 * timeout.rb: Document Timeout::timeout 0 and nil argument behavior



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 35112,35121: [Backport #6190]

	* transcode.c (str_encode_bang, encoded_dup): if nothing was
	  transcoded, just set encoding but leave coderange unchanged as
	  forcee_encoding.  [ruby-core:43557][Bug #6190]

	* transcode.c (documentation for str_encode): Explain
	  that transcoding to the same encoding is a no-op
	  (i.e. no exceptions, no replacements,...).
	  [ruby-core:43557][Bug #6190]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 36338: [Backport #6709]

	* configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
	  instead of TARGET which may contain non-identifer characters.

	* lib/mkmf.rb (create_makefile): add TARGET_NAME which is the first
	  part consists of only word characters.  [ruby-core:46248][Bug #6709]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
merge revision(s) 39578: [Backport #8009]

	* Makefile.in (miniruby, ruby): move MAINLIBC because linker arguments
	  must appear after object files with newer versions of gcc.  patch by
	  tmm1 (Aman Gupta) in [ruby-core:53121] [Bug #8009]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e