* file.c: remove unnecessary the source path from EEXIST error
messages and show the destination path only. [ruby-core:59202]
[Feature #9263]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_readlink): fix buffer overflow on a long symlink. since
rb_str_modify_expand() expands from its length but not its capacity,
need to set the length properly for each expansion.
[ruby-core:58592] [Bug #9157]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (GetLastError): already defined in windows.h on nowadays
cygwin, and caused the confliction with the system provided
definition on cygwin64. by @kou1okada [Fixes GH-433].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Based on patch by Prathamesh Sonpatki. [ruby-core:57734] [Bug #9002]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (stat_new_0): constify.
* file.c (rb_stat_new): constify and export. based on a patch by
Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (file_s_fnmatch): ditto.
* dir.c (Init_Dir): [DOC] Document File::Constants::FNM_XXX
constants. (These won't show up in RDoc until a new RDoc is
imported.)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_str_encode_ospath): OS path encoding on Mac OS X is also
fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_str_normalize_ospath0): make the internal function
static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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