aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* dir.c: getattrlist on OSX 10.5nobu2015-04-101-5/+15
| | | | | | | * dir.c (need_normalization): use getattrlist() if fgetattrlist() is unavailable, on OSX 10.5. [ruby-core:68829] [Bug #11054] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: expand ruby_brace_glob0nobu2015-04-011-11/+4
| | | | | | | | * dir.c (ruby_brace_glob_with_enc): call ruby_brace_glob_with_enc in ruby_brace_glob, and expanded ruby_brace_glob0 which is no longer used anywhere else. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: reduce indirect argumentsnobu2015-04-011-6/+21
| | | | | | | * dir.c (push_glob): remove indirect links of arguments for trampoline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: don't raise after closenobu2015-03-231-4/+10
| | | | | | | * dir.c (dir_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: w32_lstati64nobu2015-03-231-0/+2
| | | | | | | | * win32/win32.c (winnt_stat): stat with following symbolic links. * win32/win32.c (winnt_lstat): rename old winnt_stat, which does not follow symbolic links. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fix DT_UNKNOWN recursionnobu2015-03-171-26/+38
| | | | | | | | | * dir.c (glob_helper): distinguish not-yet-stated and DT_UNKNOWN by readdir, and traverse recursively for the former. Linux readdir returns DT_UNKNOWN on some filesystems, e.g., smbfs, iso9660. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: DT_UNKNOWNnobu2015-03-161-1/+3
| | | | | | * dir.c (glob_helper): deal with DT_UNKNOWN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.h: direct::d_typenobu2015-03-141-2/+2
| | | | | | | | | | * dir.c (glob_helper): use d_type to reduce lstat system calls. * win32/dir.h (struct direct): add d_type instead of d_isdir and d_isrep. SYMLINKD is unreliable, since the target can be replaced after a link was created. * win32/win32.c (readdir_internal): set d_type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob short namesnobu2015-03-081-1/+13
| | | | | | | | | * dir.c (glob_helper): match patterns against legacy short names too, not only ordinary names. [ruby-core:67954] [Bug #10819] * win32/dir.h (struct direct): add short name members. * win32/win32.c (opendir_internal, readdir_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (replace_real_basename): need to check the return value ofusa2015-03-051-6/+18
| | | | | | | | GLOB_REALLOC(). [ruby-core:68430] [Bug #10941] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (replace_real_basename): shouldn't create Ruby object beforeusa2015-03-051-5/+15
| | | | | | | | the object system is loaded. [ruby-core:68430] [Bug #10941] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: same encoding to the patternnobu2015-02-251-7/+15
| | | | | | | * dir.c (push_pattern, push_glob): make globbed file names same encoding to the given pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: use packed structsnobu2015-02-241-4/+11
| | | | | | | | * dir.c (is_case_sensitive, replace_real_basename): [OSX] use packed structs instead of arrays to suppress warning by older versions of gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_funcallvnobu2015-02-161-1/+1
| | | | | | | * use rb_funcallv() for no arguments call instead of variadic rb_funcall(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: long path name on Windowsnobu2015-02-071-19/+13
| | | | | | | | | * dir.c (has_magic): always get long path name on Windows even if no tilde is there. [ruby-core:68011] [Bug #10819] * dir.c (replace_real_basename): FindFirstFile ignore redirection character, check if exists before call it. cf. [Bug #8597] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fix a typonobu2015-02-071-1/+1
| | | | | | * dir.c (has_magic): fix a typo, check code not c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: use USE_NAME_ON_FSnobu2015-02-071-2/+2
| | | | | | | * dir.c (glob_helper): use USE_NAME_ON_FS instead of configure and platform macro list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fix escaping multibyte charnobu2015-02-071-3/+3
| | | | | | | * dir.c (has_magic): fix escaping multibyte char, with glob meta-char in trailing bytes, e.g., Shift-JIS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: preserve encodingnobu2015-02-061-12/+40
| | | | | | | * dir.c (sys_enc_warning_in): preserve encoding of path name in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove duplication in warningnobu2015-02-031-1/+1
| | | | | | | * dir.c (sys_warning_1): remove duplication in the message. * error.c (rb_mod_sys_fail_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob legacy short namenobu2015-02-031-7/+68
| | | | | | | | * dir.c (glob_helper): obtain real name with FindFirstFile API instead of matchin all entries, on Windows. [ruby-core:67954] [Bug #10819] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: GC guardnobu2015-02-031-1/+4
| | | | | | | * dir.c (do_opendir): prevent intermediate string for transcoding from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: OSX case-foldingnobu2015-01-081-1/+22
| | | | | | | | * dir.c (glob_helper): match in case-folding only if the directory resides on a case-insensitve file system, on OSX. [ruby-core:67364] [Bug #10700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: use macrosnobu2015-01-071-2/+2
| | | | | | | * dir.c (replace_real_basename): use macros for getattrlist buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: cifs symlinkd on OSXnobu2015-01-071-0/+9
| | | | | | | * dir.c (dir_initialize): workaround of opendir failure at symlink directories on Windows via CIFS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: GC guardnobu2015-01-071-2/+5
| | | | | | | * dir.c (dir_initialize): add GC guard for retrying. the argument of RSTRING_PTR() may be eliminated by optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: normalize CIFS toonobu2015-01-071-30/+42
| | | | | | | * dir.c (need_normalization): not only HFS+, CIFS (SMB) is also decomposed. [Bug #10704] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "dir.c: NORMALIZE_UTF8PATH"nobu2015-01-071-23/+38
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: NORMALIZE_UTF8PATHnobu2015-01-071-38/+23
| | | | | | | | * dir.c (NORMALIZE_UTF8PATH): Unicode decomposition seems to perform in an upper layer than file systems on OSX, as all path names are always decomposed regardless of file system types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* never-NULL pointer checknobu2014-12-261-1/+1
| | | | | | | | * dir.c (ruby_glob0): no need to check never-NULL pointer. reported by Denis Denisov <denji0k AT gmail.com>. * win32/file.c (rb_file_expand_path_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: replace_real_basenamenobu2014-12-251-2/+61
| | | | | | | | | | * dir.c (replace_real_basename): get the real name and replace the base name with it by getattrlist(2) if available. suggested by Matthew Draper at [ruby-core:67116]. [Bug #10015] * dir.c (glob_helper): get the real name of the whole path, not only the last name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r48975nobu2014-12-241-5/+1
| | | | | | caused CI fauilures git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: shortcut for case-insensitive namenobu2014-12-241-1/+5
| | | | | | | | * dir.c (glob_helper): shortcut for case-insensitive name by stopping reading after a matching name found. [ruby-core:63591] [Bug #10015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob performancenobu2014-12-241-1/+2
| | | | | | | | * dir.c (glob_make_pattern): restrict searching case-insensitive name from the filesystem to only last part, for the performance. [ruby-core:63591] [ruby-core:63591] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use 0 for reservednobu2014-12-011-1/+1
| | | | | | | use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Include ruby.h and ruby/encoding.h to beakr2014-11-151-2/+0
| | | | | | | | includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fix rdoc [ci skip]nobu2014-10-081-2/+0
| | | | | | | | | * dir.c (dir_s_aref): fix rdoc. `Dir.glob` allows an array but `Dir[]` not. the former accepts an optional parameter `flags`, while the latter accepts arbitrary number of arguments but no `flags`. [ruby-core:65265] [Bug #10294] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* protoize no-arguments functionsnobu2014-09-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (dirfd): Check function.akr2014-09-041-0/+32
| | | | | | | | | * dir.c (dir_fileno): New method. [ruby-dev:48265] [Feature #9880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (glob_helper): use #ifdef instead of #if.ko12014-09-041-2/+2
| | | | | | | | | | | gcc's -Wundef option shows warning for undefined macro. * numeric.c (flo_is_finite_p): ditto. * vm_dump.c (rb_vmdebug_thread_dump_state): ditto. * vm_core.h: define VM_DEBUG_VERIFY_METHOD_CACHE to 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: Dir.exists? is deprecatednobu2014-08-111-1/+6
| | | | | | | * dir.c (rb_dir_exists_p): [DOC] Document that Dir.exists? is deprecated. [ruby-core:64135] [Bug #10102] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add some documents [ci skip]nobu2014-07-281-0/+6
| | | | | | | | | | | | | | | * bignum.c (Init_Bignum): [DOC] Bignum::GMP_VERSION. * complex.c (Init_Complex): [DOC] ignore an internal class. * dir.c (Init_Dir): [DOC] File::FNM_SYSCASE. * file.c (rb_file_exists_p): [DOC] File.exists? is deprecated. * object.c (rb_mod_initialize_clone): [DOC] ignore implementation detail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* encoding.h: constify rb_encodingnobu2014-06-021-4/+4
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` itself, not only arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: try match PLAINnobu2014-05-171-0/+1
| | | | | | | * dir.c (glob_helper): try match PLAIN as well as ALPHA, which are separated by previous commits. [ruby-core:61552] [Bug #9648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: set PLAIN for non-magicalnobu2014-05-171-1/+1
| | | | | | | | * dir.c (glob_make_pattern): set PLAIN for non-magical path to skip parts which not need to glob. [ruby-core:61552] [Bug #9648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fix conditions for ALPHAnobu2014-05-171-5/+6
| | | | | | | | | * dir.c (has_magic): return ALPHA at alphabetical name regardless FNM_CASEFOLD flag. * dir.c (glob_helper): fix conditions for ALPHA. [ruby-core:61552] [Bug #9648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: reduce matchingnobu2014-05-161-0/+18
| | | | | | | * dir.c (glob_helper): reduce matching at non-mgaical path on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: match plain names as-isnobu2014-05-161-15/+23
| | | | | | | | | * dir.c (glob_pattern_type): separate names with alphabet but no magical from plain. * dir.c (glob_helper): match plain names as-is to treat super-root same as the root. [ruby-core:61552] [Bug #9648] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: check boundarynobu2014-05-161-1/+1
| | | | | | * dir.c (glob_make_pattern): check boundary before accessing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: match in UTF-8nobu2014-05-101-0/+6
| | | | | | | * dir.c (push_glob): match in UTF-8 on Mac OS X. [ruby-dev:48213] [Bug #9825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e