summaryrefslogtreecommitdiff
path: root/dir.c
AgeCommit message (Collapse)Author
2014-02-16dir.c (dir_s_glob): RB_GC_GUARD instead of volatilenormal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05dir.c: fallback to ASCII-8BITnobu
* 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
2014-02-04dir.c: glob cases on case-insensitive systemnobu
* 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
2014-02-04dir.c: glob cases on case-insensitive systemnobu
* 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
2014-02-04Revert "dir.c: glob cases on case-insensitive system"naruse
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
2014-02-03dir.c: glob cases on case-insensitive systemnobu
* 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
2014-01-21* dir.c: Add example for Dir.pwd in Dir.getwd doc by @jasonrclark [fix GH-504]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-06vm_insnhelper.c: rb_get_kwargsnobu
* 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
2013-11-30dir.c: check unknown keywordsnobu
* 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
2013-11-08* dir.c, pack.c, ruby.c, struct.c, vm_eval.c: use RARRAY_CONST_PTR().glass
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
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
2013-10-22dir.c: DOTMATCH to current directorynobu
* 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
2013-10-21dir.c: warn Dir.exists?nobu
* 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
2013-09-13* dir.c (dir_s_glob): [DOC] Improve wording and layout.drbrain
* 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
2013-08-31dir.c: reduce string objectnobu
* 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
2013-08-10dir.c: normalizationnobu
* dir.c (glob_helper): re-enalbe normalization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-10* file.c (rb_str_normalize_ospath):naruse
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
2013-08-08file.c: rb_str_normalize_ospathnobu
* 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
2013-07-25fix typonaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25file.c: split rb_home_dirnobu
* 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
2013-07-19* dir.c: [DOC] add docs for :encoding option.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-03dir.c: get rid of FindFirstFile bugnobu
* 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
2013-07-03dir.c: do_lstat aliasnobu
* 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
2013-07-02dir.c: use built-in encoding indexesnobu
* 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
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
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
2013-06-03dir.c: use fd to fstatfsnobu
* 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
2013-06-02* configure.in: removes AC_CHECK_FUNCS(readdir_r). readdir_r()kosaki
is only used from dir.c and it doesn't need readdir_r(). * configure.in (SIZEOF_STRUCT_DIRENT_TOO_SMALL): remvoed. It is only used for readdir_r. * dir.c: removes NAME_MAX_FOR_STRUCT_DIRENT. It is not right way to detect maximum length of path len. POSIX require to use fpathconf(). IOW, it might have lead to make a vulnerability using stack smashing. Moreover, readdir() works enough for our usage. * dir.c (READDIR): removes an implementation which uses readdir_r() and parenthesize in a macro body correctly. * dir.c (dir_read): removes IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT entry), it is used only for readdir_r(). * dir.c (dir_each): ditto. * dir.c (glob_helper): ditto. * dir.c (READDIR): removes entry and dp argument. * dir.c (dir_read): adjust for the above change. * dir.c (dir_each): ditto. * dir.c (glob_helper): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25* dir.c (bracket): fix copy-paste error. When the first and lastmame
characters of fnmatch range have different length, fnmatch may have wrongly matched a path that does not really match. Coverity Scan found this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-20dir.c: compose HFS file namesnobu
* dir.c (dir_each): compose HFS file names from UTF8-MAC. [ruby-core:48745] [Bug #7267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-26* dir.c (dir_set_pos): Fix a compilation error when seekdir() is notakr
exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18dir.c: not skip dot directories if matchingnobu
* dir.c (glob_helper): should skip dot directories only for recursion, but should not if matching to the given pattern. [ruby-core:54387] [Bug #8283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-14* dir.c (File.fnmatch): fix typo in documentationeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12* array.c: Document synonymous methods, by windwiny [GH-277]zzak
* bignum.c: ditto * complex.c: ditto * dir.c: ditto * encoding.c: ditto * enumerator.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * string.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11Fix return value in example by @rkh [fix GH-284]hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11* dir.c: Fix a typo.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-11* dir.c (file_s_fnmatch): Document File::FNM_EXTGLOB flag.zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19compose HFS file namesnobu
* dir.c (glob_helper): compose HFS file names from UTF8-MAC. [ruby-core:48745] [Bug #7267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19 * dir.c (join_path): move length of path to an argument.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-15file.c: rb_sys_fail_path_with_funcnobu
* 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
2013-02-23dir.c: encoding checknobu
* dir.c (file_s_fnmatch, fnmatch_brace): encoding-incompatible pattern and string do not match, instead of exception. [ruby-dev:47069] [Bug #7911] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()usa
and renamed from rb_w32_readdir_with_enc(). [ruby-core:24864] [Feature #1927] * dir.c (READDIR): follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01dir.c: use NAMLENnobu
* dir.c (glob_helper): use NAMLEN() to tell the length of d_name instead of strlen(), which can access beyond the boundary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04dir.c: FNM_EXTGLOBnobu
* dir.c (file_s_fnmatch): match with expanding braces if FNM_EXTGLOB is set. [ruby-core:40037] [Feature #5422] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03* dir.c (Dir#glob):zzak
Documentation for pattern section, backslash subsection Patch by Eric Bouchut [ruby-core#48528] [Bug #7230] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-05dir.c: fix recursionnobu
* dir.c (glob_make_pattern): names under recursive need to be single basenames to match for each name. [ruby-core:47418] [Bug #6977] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-05dir.c: not recurse dot filesnobu
* dir.c (glob_helper): skip dot files early on recursive match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-05dir.c: enumm answernobu
* dir.c (enumm answer): remap NO and YES to false and true, respectively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-19* dir.c (dir_initialize): get rid of "unused return: argc = rb_scan_args()"kosaki
warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-17documentation for Dir.exist?nobu
* dir.c (rb_file_directory_p): move documentation for Dir.exist? from file.c so that the proper description will be shown instead of the documentation of File.directory?. [ruby-core:45685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-17Imports Ruby's port to NativeClient (a.k.a NaCl).yugui
Patch by Google Inc. [ruby-core:45073]. * configure.in (RUBY_NACL): New M4 func to configure variables for NaCl. (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names of Pepper interface types. (BTESTRUBY): New variable to specify which ruby should be run on "make btest". NaCl can run the built binary by sel_ldr, but it need rbconfig.rb. So this variable is distinguished from $MINIRUBY. * thread_pthread.c: Disabled some features on NaCl. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * file.c: ditto. * missing/flock.c: ditto. * nacl/pepper_main.c: An example implementation of Pepper application that embeds Ruby. * nacl/example.html: An example of web page that uses the Pepper application. * nacl/nacl-config.rb: Detects variants of NaCl SDK. * nacl/GNUmakefile.in: Makefile template for NaCl specific build process. * nacl/package.rb: script for packaging a NaCl-Ruby embedding application. * nacl/reate_nmf.rb: Wrapper script of create_nmf.py * dln.c (dln_load): Added a hack to call on NaCl. * util.c (ruby_getcwd): Path to the current directort is not available on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e