summaryrefslogtreecommitdiff
path: root/dir.c
AgeCommit message (Collapse)Author
2010-01-23* dir.c (dir_s_glob): get rid of comment starter.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-23* dir.c (dir_s_glob): add rdoc by Roger Pack. [ruby-core:27669]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-12* prelude.rb (require_relative): use File.realpath. [ruby-dev:40040]akr
* include/ruby/intern.h: declare rb_dir_getwd. * dir.c (rb_dir_getwd): copied from dir_s_getwd to export. (dir_s_getwd): use rb_dir_getwd. * file.c (rb_file_s_realpath): new method File.realpath. (rb_file_s_realdirpath): new method File.realdirpath. * lib/pathname.rb (Pathname#realpath): use File.realpath. (Pathname#realdirpath): use File.realdirpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03* dir.c (dir_check): moved other checks from GetDIR.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03* dir.c (GetDIR): fixed a variable name.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-19* dir.c (GlobPathValue), file.c (rb_get_path_check): path namesnobu
must be ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18* dir.c (GlobPathValue): adjust return types. based on a patchnobu
from Naohisa Goto at [ruby-dev:39350]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18* dir.c (GlobPathValue): glob allows null bytes as separators.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-17* dir.c (push_glob): str should be a string always.nobu
* dir.c (rb_push_glob, dir_globs): use #to_path to convert non- string values. cf. [ruby-dev:39345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09* dir.c (dir_data_type): typed.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-03* dir.c (Init_Dir): alias Dir#path to Dir#to_path. [ruby-core:25326]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19* dir.c (DEFINE_STRUCT_DIRENT): use union to allocate sufficientmatz
memory space for Solaris. a patch from Naohisa GOTO <ngoto at gen-info.osaka-u.ac.jp> in [ruby-dev:39132]. [ruby-dev:39062] * configure.in (SIZEOF_STRUCT_DIRENT_TOO_SMALL): Solaris dirent check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* dir.c (push_glob): re-fix GC problem.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* dir.c (push_glob): fix GC problem.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22* io.c: remove __CHECKER__ test.akr
* dir.c: ditto. * dln.c: ditto. * file.c: ditto. * process.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-10 * dir.c (dir_s_getwd): directory path's encoding should be filesystem'susa
one. * lib/tmpdir.rb: ditto (but not finished yet.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-09* dir.c (dir_s_glob): fixed rdoc. a patch from Joseph Pecoraro atnobu
[ruby-core:23767]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-09* dir.c (sys_warning): get rid of type-punning function cast.nobu
* dir.c (ruby_glob0): get rid of possible overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22 * dir.c (glob_helper): C99(gcc)-ism.usa
* time.c (find_time_t): GUESS macro needs the variable named ``result'' always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-21* dir.c (dir_path, dir_each, glob_helper): use readdir_r() ifnobu
available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-16* node.h (rb_notimplement_body_p): declared.akr
* vm_method.c (Init_eval_method): suppress a warning. * io.c (rb_io_fsync): use rb_f_notimplement if not implemented. (rb_io_close_on_exec_p): ditto. (rb_io_set_close_on_exec): ditto. (rb_io_fcntl): ditto. (rb_f_syscall): ditto. * dir.c (dir_tell): ditto. (dir_seek): ditto. (dir_s_chroot): ditto. * process.c (proc_getpgrp): ditto. (proc_setpgrp): ditto. (proc_getpgid): ditto. (proc_setpgid): ditto. (proc_setsid): ditto. (proc_getpriority): ditto. (proc_setpriority): ditto. (proc_getrlimit): ditto. (proc_setrlimit): ditto. (p_sys_setuid): ditto. (p_sys_setruid): ditto. (p_sys_seteuid): ditto. (p_sys_setreuid): ditto. (p_sys_setresuid): ditto. (p_sys_setgid): ditto. (p_sys_setrgid): ditto. (p_sys_setegid): ditto. (p_sys_setregid): ditto. (p_sys_setreuid): ditto. (p_sys_setresgid): ditto. (p_sys_issetugid): ditto. (proc_getgroups): ditto. (proc_setgroups): ditto. (proc_initgroups): ditto. (proc_daemon): ditto. (rb_proc_times): ditto. * file.c (rb_file_s_lchown): ditto. (rb_file_s_link): ditto. (rb_file_s_symlink): ditto. (rb_file_s_readlink): ditto. (rb_file_s_truncate): ditto. (rb_file_truncate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-16* dir.c (bracket): fix escape handling for range character in bracketmame
of fnmatch pattern. e.g., '[a\-c]' should not match 'b'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-15* dir.c (fnmatch_helper): use rb_enc_precise_mbclen andnaruse
fail if bytes are invalid. [ruby-dev:38307] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-14* dir.c (bracket): if same in bytes, path is matching.nobu
[ruby-dev:38305] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-12* dir.c (bracket, fnmatch_helper): compare bytewise first, to getnobu
rid of invalid byte sequence. [ruby-dev:38303] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,nobu
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11* dir.c (dir_seek): use long for seekdir().nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06* dir.c (dir_read): don't disable rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 * win32/{dir.h, win32.c} (rb_w32_readdir_with_enc): new function tousa
read entry with specified enc. * win32/win32.c (readdir_internal): extract from rb_w32_opendir(). * win32/win32.c (opendir_internal): extract from rb_w32_readdir(). * dir.c (dir_read, dir_each): use new READDIR macro instead of readdir() to pass enc for special version of readdir, such as above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02* dir.c (dir_s_home): new method. [ruby-core:21454]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-25* dir.c (join_path): use strlcat() to force link.nobu
* dir.c (glob_helper): no strcpy() is needed since len is known. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-31* dir.c (dir_globs): need taint check. reported by stevematz
<oksteev at gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-18* string.c (rb_external_str_new): a new function to convert frommatz
external encoding to internal encoding. if something went wrong, it returns a string with the external encoding. * string.c (rb_external_str_new_with_enc): same as above besides you can specify the source encoding. * ruby.c (ruby_set_argv): use rb_external_str_new() * ruby.c (set_arg0, ruby_script): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-11* include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned int.naruse
* include/ruby/encoding.h (rb_enc_codepoint): ditto. * encoding.c (rb_enc_codepoint): signed int to unsigned int. * encoding.c (rb_enc_ascget): ditto. * string.c (rb_str_casecmp): ditto. * string.c (enc_succ_alnum_char): ditto. * string.c (rb_str_inspect): ditto. * string.c (rb_str_upcase_bang): ditto. * string.c (rb_str_downcase_bang): ditto. * string.c (rb_str_capitalize_bang): ditto. * string.c (rb_str_swapcase_bang): ditto. * string.c (struct tr): ditto. * string.c (trnext): ditto. * string.c (tr_trans): ditto. * string.c (tr_setup_table): ditto. * string.c (tr_find): ditto. * string.c (rb_str_delete_bang): ditto. * string.c (rb_str_squeeze_bang): ditto. * string.c (rb_str_count): ditto. * string.c (rb_str_split_m): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_lstrip_bang): ditto. * string.c (rb_str_rstrip_bang): ditto. * string.c (rb_str_intern): ditto. * dir.c (char_casecmp): ditto. * sprintf.c (rb_str_format): ditto. * enc/emacs_mule.c (mbc_to_code): to be 32bit clean. * enc/emacs_mule.c (code_to_mbc): ditto. * enc/gb18030.c (mbc_to_code): ditto. * enc/gb18030.c (code_to_mbc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08* dir.c (dir_initialize): rename option name of Dir.opennaruse
from :external_encoding to :encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22* dir.c (dir_enc_str_new): set US-ASCII to the pathnaruse
when the path is 7bit string and encoding is ASCII compatible. * dir.c (push_glob): set file system encoding when argument encoding is US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22* dir.c (dir_enc_str_new): renamed from dir_enc_str.naruse
* dir.c (dir_read): use dir_enc_str_new. * dir.c (dir_each): ditto. * dir.c (push_pattern): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14* encoding.c (rb_filesystem_encoding): use default external encodingakr
for Unix. * dir.c (dir_initialize): don't cache fs_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30* dir.c (struct dir_data): change path field char * to VALUE.akr
(mark_dir): new function for mark path field. (free_dir): follow the path field change. (dir_s_alloc): ditto. (dir_initialize): ditto. (dir_s_open): ditto. (dir_inspect): ditto. (dir_path): return (duplicate of) the path field to preserve encoding. [ruby-dev:35685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-29* dir.c (char_casecmp): fix: return 0 if either of characters is NUL.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28* dir.c (struct dir_data): intenc field removed.akr
(dir_s_alloc): intenc initialization removed. (dir_initialize): :internal_encoding option removed. dirname code conversion removed. (dir_enc_str): code conversion removed. [ruby-dev:35661] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22* compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu
iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm), process.c (pst_message), re.c (match_inspect): use rb_str_catf. * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use rb_sprintf. * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use rb_vsprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-20* dir.c (dir_initialize): use rb_convert_type instead ofakr
rb_check_convert_type to prevent SEGV by Dir.new(".", true). (dir_initialize): use FilePathValue before rb_enc_get(dirname) to prevent SEGV by Dir.new(0). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-09* dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),nobu
(glob_brace): make consistent prototypes. * dir.c (push_glob): set enc in the caller of rb_glob_caller as well as rb_glob2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 * dir.c: shoudn't use ruby object in globbing, because glob serviceusa
routines are called before initializing ruby on some platforms (ex. windows). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08* dir.c (Next): use rb_enc_mbclen. [ruby-dev:35390]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07* dir.c (Next): use rb_enc_precise_mbclen.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07* dir.c: preserve encoding of strings in glob and fnmatch.naruse
* include/ruby/ruby.h: related changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e