rdoc can't handle correctly the return value when the file has invalid character
From r30806 to r30813, make rdoc raises error on LANG=C environment like:
This is because the encoding of output is set to US-ASCII, failed character
encoding conversion on doc/re.rdoc, and wrongly treated nil as String.
The main bug is set to US-ASCII, so I fixed it in r30813.
But nil treatment should be rdoc's bug, so I report this.
Generating RDoc documentation
unable to convert U+6771 from UTF-8 to US-ASCII for ../../ruby/doc/re.rdoc, skipping
Before reporting this, could you check that the file you're documenting
has proper syntax:
/home/naruse/local/ruby/bin/ruby -c ../../ruby/re.c
RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.
The internal error was:
(NoMethodError) undefined method `sub' for nil:NilClass
include_file'block in handle'
handle_class_module'block in do_classes'
block in parse_files'map'
<main>'sub' for nil:NilClass
uh-oh! RDoc had a problem:
run with --debug for full backtrace
*** Error code 1
Stop in /home/naruse/obj/ruby.