summaryrefslogtreecommitdiffstats
path: root/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* * dir.c (dir_check): moved other checks from GetDIR.nobu2009-11-031-6/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (GetDIR): fixed a variable name.nobu2009-11-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (GlobPathValue), file.c (rb_get_path_check): path namesnobu2009-09-191-1/+4
| | | | | | | must be ASCII compatible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (GlobPathValue): adjust return types. based on a patchnobu2009-09-181-1/+1
| | | | | | | from Naohisa Goto at [ruby-dev:39350]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (GlobPathValue): glob allows null bytes as separators.nobu2009-09-181-3/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (push_glob): str should be a string always.nobu2009-09-171-3/+3
| | | | | | | | * dir.c (rb_push_glob, dir_globs): use #to_path to convert non- string values. cf. [ruby-dev:39345] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_data_type): typed.nobu2009-09-091-13/+23
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (Init_Dir): alias Dir#path to Dir#to_path. [ruby-core:25326]matz2009-09-031-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (DEFINE_STRUCT_DIRENT): use union to allocate sufficientmatz2009-08-191-6/+39
| | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@24585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (push_glob): re-fix GC problem.ko12009-07-151-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (push_glob): fix GC problem.ko12009-07-151-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: remove __CHECKER__ test.akr2009-06-221-1/+1
| | | | | | | | | | | | | | * dir.c: ditto. * dln.c: ditto. * file.c: ditto. * process.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_s_getwd): directory path's encoding should be filesystem'susa2009-06-101-0/+1
| | | | | | | | | | one. * lib/tmpdir.rb: ditto (but not finished yet.) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_s_glob): fixed rdoc. a patch from Joseph Pecoraro atnobu2009-06-091-1/+1
| | | | | | | [ruby-core:23767]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (sys_warning): get rid of type-punning function cast.nobu2009-06-091-6/+7
| | | | | | | * dir.c (ruby_glob0): get rid of possible overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (glob_helper): C99(gcc)-ism.usa2009-04-221-1/+2
| | | | | | | | | * time.c (find_time_t): GUESS macro needs the variable named ``result'' always. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_path, dir_each, glob_helper): use readdir_r() ifnobu2009-04-211-10/+19
| | | | | | | available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (rb_notimplement_body_p): declared.akr2009-04-161-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@23197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (bracket): fix escape handling for range character in bracketmame2009-04-161-1/+1
| | | | | | | of fnmatch pattern. e.g., '[a\-c]' should not match 'b'. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (fnmatch_helper): use rb_enc_precise_mbclen andnaruse2009-04-151-1/+3
| | | | | | fail if bytes are invalid. [ruby-dev:38307] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (bracket): if same in bytes, path is matching.nobu2009-04-141-2/+5
| | | | | | | [ruby-dev:38305] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (bracket, fnmatch_helper): compare bytewise first, to getnobu2009-04-121-31/+42
| | | | | | | rid of invalid byte sequence. [ruby-dev:38303] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,nobu2009-03-171-2/+3
| | | | | | | | string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_seek): use long for seekdir().nobu2009-03-111-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_read): don't disable rdoc.akr2009-02-061-3/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/{dir.h, win32.c} (rb_w32_readdir_with_enc): new function tousa2009-02-061-2/+7
| | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@22087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_s_home): new method. [ruby-core:21454]nobu2009-02-021-0/+25
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (join_path): use strlcat() to force link.nobu2009-01-251-6/+8
| | | | | | | * dir.c (glob_helper): no strcpy() is needed since len is known. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_globs): need taint check. reported by stevematz2008-10-311-1/+1
| | | | | | <oksteev at gmail.com> git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_external_str_new): a new function to convert frommatz2008-10-181-13/+3
| | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@19834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned int.naruse2008-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_initialize): rename option name of Dir.opennaruse2008-09-081-15/+15
| | | | | | from :external_encoding to :encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_enc_str_new): set US-ASCII to the pathnaruse2008-08-221-0/+4
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@18770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_enc_str_new): renamed from dir_enc_str.naruse2008-08-221-8/+7
| | | | | | | | | | * dir.c (dir_read): use dir_enc_str_new. * dir.c (dir_each): ditto. * dir.c (push_pattern): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encoding): use default external encodingakr2008-08-141-3/+1
| | | | | | | | | | for Unix. * dir.c (dir_initialize): don't cache fs_encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-3/+3
| | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (struct dir_data): change path field char * to VALUE.akr2008-07-301-12/+16
| | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@18269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (char_casecmp): fix: return 0 if either of characters is NUL.naruse2008-07-291-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (struct dir_data): intenc field removed.akr2008-07-281-38/+4
| | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@18250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu2008-07-221-4/+1
| | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_initialize): use rb_convert_type instead ofakr2008-07-201-2/+2
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@18139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),nobu2008-07-091-7/+9
| | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@17966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c: shoudn't use ruby object in globbing, because glob serviceusa2008-07-081-51/+73
| | | | | | | | | routines are called before initializing ruby on some platforms (ex. windows). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (Next): use rb_enc_mbclen. [ruby-dev:35390]naruse2008-07-081-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (Next): use rb_enc_precise_mbclen.naruse2008-07-071-16/+24
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c: preserve encoding of strings in glob and fnmatch.naruse2008-07-071-152/+93
| | | | | | * include/ruby/ruby.h: related changes. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.rb: fix resource leak.mame2008-06-291-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (Init_Dir): dir_foreach() takes variable argument.usa2008-06-171-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_data): add intenc and extenc.naruse2008-06-161-16/+86
| | | | | | | | | | | | | | | | | | | | | | | | | * dir.c (dir_s_alloc): ditto. * dir.c (dir_initialize): now accept internal_encoding and exernal_encoding. * dir.c (dir_s_open): changed for dir_initialize. * dir.c (dir_open_dir): ditto. * dir.c (dir_foreach): changed for dir_oepn_dir. * dir.c (dir_entries): changed for dir_oepn_dir. * dir.c (dir_enc_str): defined. * dir.c (dir_path): use dir_enc_str. * dir.c (dir_read): ditto. * dir.c (dir_each): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e