* 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_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
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_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
* 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 (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 (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
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
* 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 (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): 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 (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
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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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