HFS Plus (Mac OS Extended) uses a variant of Normal Form D in which
U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through
U+2FAFF are not decomposed (this avoids problems with round trip
conversions from old Mac text encodings).
http://developer.apple.com/library/mac/qa/qa1173/_index.html
Therefore fix r42457 to exclude the range.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_str_normalize_ospath): normalize to Normalization Form C
using CFString.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_expand_path_internal): should clear coderange after
copying user name as binary data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_s_home): use rb_home_dir_of and rb_default_home_dir.
* file.c (rb_home_dir_of): split from rb_home_dir() for the home
directry of the given user, and the user name is a VALUE, not a bare
pointer. should raise if the user does not exist.
* file.c (rb_default_home_dir): split from rb_home_dir() for the home
directry of the current user.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_expand_path_internal): preserve the file name
encoding in an exception message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: adds RUBY_REPLACE_TYPE(off_t) for creating
NUM2OFFT.
* file.c (rb_file_truncate): use correct type. chsize() take
a long.
* include/ruby/ruby.h (NUM2OFFT): use a definition created by
a configure script by default.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c (syserr_initialize): add optional function name.
* error.c (rb_sys_fail_path_in): rename and move from file.c, and pass
func_name to SystemCallError#initialize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_sys_fail_path_with_func): share same function, and path
may be nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_sys_fail_path0): insert separator between function name
and path name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (rb_cv_function_name_string): macro for function name
string predefined identifier, __func__ in C99, or __FUNCTION__ in
gcc.
* file.c (rb_sys_fail_path): use RUBY_FUNCTION_NAME_STRING.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h (RB_MAX_GROUPS): here.
* file.c (rb_group_member): use RB_MAX_GROUPS instead of
RUBY_GROUP_MAX. They are the same.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_thread_polling(). When getting EAGAIN, we need to wait a
while even if no multi threading.
* thread.c (sleep_for_polling, rb_thread_polling) removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
files ending with a dot. Also, added example for this.
[ruby-core:47852] [Bug #7112]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (Init_File): replace with rb_file_const() with
rb_define_const() because RDoc don't care rb_file_const.
[Bug #5530]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_get_path_check_to_string): extract from
rb_get_path_check(). We change the spec not to call to_path of
String object.
* file.c (rb_get_path_check_convert): extract from rb_get_path_check().
* file.c (rb_get_path_check): follow the above change.
* file.c (rb_file_expand_path_fast): remove check_expand_path_args().
Instead we call it in load.c.
* file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to
reduce expand cost.
* file.c (rb_find_file_safe): ditto.
* internal.h (rb_get_expanded_load_path): add a declaration.
* internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
add declarations.
* load.c (rb_construct_expanded_load_path): fix for compatibility.
Same checks in rb_get_path_check() are added. We don't replace
$LOAD_PATH and ensure that String object of $LOAD_PATH are frozen.
We don't freeze non String object and expand it every times. We add
arguments for expanding load path partially and checking if load path
have relative paths or non String objects.
* load.c (load_path_getcwd): get current working directory for checking
if it's changed when getting load path.
* load.c (rb_get_expanded_load_path): fix for rebuilding cache properly.
We check if current working directory is changed and rebuild expanded
load path cache. We expand paths which start with ~ (User HOME) and
non String objects every times for compatibility. We make this
accessible from other source files.
* load.c (rb_feature_provided): call rb_get_path() since we changed
rb_file_expand_path_fast() not to call it.
* load.c (Init_load): initialize vm->load_path_check_cache.
* vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC.
* vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data
to check load path cache validity.
* test/ruby/test_require.rb (TestRequire): add tests for require
compatibility related to cached expanded load path.
[ruby-core:47970] [Bug #7158]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_join): need to check again after any conversion run.
[ruby-core:48012] [Bug #7168]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_join): hide the result under construction until
return.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_join): check nul-byte only for strings, since
FilePathStringValue() does it. [ruby-core:48012] [Bug #7168]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (check_path_encoding): new function to ensure path name
encoding to be ASCII-compatible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (realpath_rec): prevent link from GC while link_names refers
the content.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_get_path_check): path name must not contain NUL bytes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_readlink): read symlink in the result string directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e