aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* dir.c (dir_s_glob): RB_GC_GUARD instead of volatilenormal2014-02-161-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: fallback to ASCII-8BITnobu2014-02-051-0/+1
| | | | | | | | * dir.c (push_glob): fallback to ASCII-8BIT for the case non-ascii path name exists. failed with LANG=C, on MacOS X which has a localized symlink on the root directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob cases on case-insensitive systemnobu2014-02-041-4/+22
| | | | | | | | * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob cases on case-insensitive systemnobu2014-02-041-1/+1
| | | | | | | * dir.c (glob_make_pattern): all alphabets are magic characters on case-insensitive filesystems. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "dir.c: glob cases on case-insensitive system"naruse2014-02-041-20/+2
| | | | | | | | | | This reverts commit r44796. * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: glob cases on case-insensitive systemnobu2014-02-031-2/+20
| | | | | | | | * dir.c (glob_helper): return the filename with actual cases on the filesystem if it is case-insensitive. [ruby-core:42469] [Feature #5994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c: Add example for Dir.pwd in Dir.getwd doc by @jasonrclark [fix GH-504]hsbt2014-01-211-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: rb_get_kwargsnobu2013-12-061-3/+2
| | | | | | | | | * vm_insnhelper.c (rb_get_kwargs): get keyword argument values from an option hash, not only checking keys. * dir.c (dir_initialize): use rb_get_kwargs. * gc.c (gc_start_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: check unknown keywordsnobu2013-11-301-4/+7
| | | | | | | * dir.c (dir_initialize): check unknown keywords. [ruby-dev:47152] [Bug #8060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c, pack.c, ruby.c, struct.c, vm_eval.c: use RARRAY_CONST_PTR().glass2013-11-081-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko12013-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: DOTMATCH to current directorynobu2013-10-221-4/+12
| | | | | | | * dir.c (glob_helper): don't skip current directories if FNM_DOTMATCH is given. [ruby-core:53108] [Bug #8006] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: warn Dir.exists?nobu2013-10-211-1/+8
| | | | | | * dir.c (rb_dir_exists_p): warn deprecated name. [Bug #9041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_s_glob): [DOC] Improve wording and layout.drbrain2013-09-131-74/+115
| | | | | | | | | | | | * 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
* dir.c: reduce string objectnobu2013-08-311-4/+3
| | | | | | * dir.c (dir_each): get rid of allocate new string from UTF-8 string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: normalizationnobu2013-08-101-1/+1
| | | | | | * dir.c (glob_helper): re-enalbe normalization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_str_normalize_ospath):naruse2013-08-101-3/+1
| | | | | | | | | | | 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_ospathnobu2013-08-081-13/+4
| | | | | | | * file.c (rb_str_normalize_ospath): extract and move from dir.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typonaruse2013-07-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: split rb_home_dirnobu2013-07-251-2/+8
| | | | | | | | | | | * 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
* * dir.c: [DOC] add docs for :encoding option.ktsj2013-07-191-3/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: get rid of FindFirstFile bugnobu2013-07-031-1/+7
| | | | | | | | * dir.c (do_stat): use rb_w32_ustati64() in win32.c to get rid of mysterious behavior of FindFirstFile() Windows API which treat "<" and ">" like as wildcard characters. [ruby-core:55764] [Bug #8597] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: do_lstat aliasnobu2013-07-031-4/+4
| | | | | | | * dir.c (do_lstat): make an alias of do_stat instead of two same functions, when no lstat is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: use built-in encoding indexesnobu2013-07-021-3/+1
| | | | | | | | * internal.h: add UTF8-MAC. * dir.c (rb_utf8mac_encoding): use built-in encoding indexes in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo2013-06-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: use fd to fstatfsnobu2013-06-031-4/+4
| | | | | | * dir.c (is_hfs): use the file descriptor instead of a path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e