aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* rdoc update.akr2008-09-071-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): applied a patch from Nobuhiro Tachinomatz2008-09-061-2/+1
| | | | | | in [ruby-dev:35948]. fix #491 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file): fix GC problem on Debian GNU/Linux (IA64)akr2008-09-041-1/+1
| | | | | | | | | with gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21). There is no register/memory to contain load_path. A register (r35) contains &RARRAY_PTR(load_path), (char*)load_path + 32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-1/+0
| | | | | | | | | | | | | | | * common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c, io.c, process.c, signal.c: vm_core.h: ditto. Some unused external global variables are also removed. (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending, rb_thread_critical) * ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c, ext/readline/readline.c, ext/socket/depend, ext/socket/socket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: rename RB_UBF_DFL toko12008-08-311-1/+1
| | | | | | | | | | RUBY_UBF_IO and RUBY_UBF_PROCESS. Because there is no default (universal) unblocking function. * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_file_s_absolute_path),nobu2008-08-291-3/+1
| | | | | | | (rb_file_absolute_path): prototyped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): check invalid access.mame2008-08-281-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_expand_path): new class method for class File.matz2008-08-281-7/+42
| | | | | | | * file.c (file_expand_path): add absolute_path handling (no ~user expansion). [ruby-core:18319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): remove path field and add pathv field.akr2008-08-231-21/+22
| | | | | | | | | | | | | | | | (MakeOpenFile): initialize pathv as Qnil. * gc.c: mark pathv field in T_FILE. * io.c: follow the rb_io_t field change. * file.c: ditto. * ext/socket/socket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_inspect): don't raise if self is not initialized.akr2008-08-211-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): reset to real class.nobu2008-08-051-2/+2
| | | | | | | | | * file.c (rb_find_file_ext, rb_find_file): ditto. * io.c (io_reopen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_mode): generalized st_mode mask.nobu2008-08-051-9/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext, rb_find_file): converts Windows style pathnobu2008-07-281-6/+18
| | | | | | | to Cygwin path. [ruby-dev:35647] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext, rb_find_file): not to split load path withnobu2008-07-281-55/+27
| | | | | | | path separator. [ruby-Bugs-21356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext, rb_find_file): converts Windows style pathnobu2008-07-241-0/+21
| | | | | | | to Cygwin path. [ruby-dev:35647] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu2008-07-221-8/+2
| | | | | | | | | | | | | | 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
* * file.c (rb_file_s_extname): fix for file name with spaces.nobu2008-07-061-1/+1
| | | | | | | [ruby-talk:307404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): no need to expand root path which has nonobu2008-06-141-3/+3
| | | | | | | short file name. [ruby-dev:35095] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-4/+3
| | | | | | | * *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko12008-06-081-9/+9
| | | | | | | | | | | | | | | | | | | enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): fix for non-existent files and SFN ofnobu2008-06-031-19/+16
| | | | | | | symlinks. [ruby-talk:303736] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings on cygwin, mingw and mswin.nobu2008-06-011-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (BUFCHECK): wrong condition. [ruby-core:16921]usa2008-05-271-4/+4
| | | | | | | | * file.c (file_expand_buf): shouldn't use buflen for length of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (BUFCHECK): no resize if enough room.nobu2008-05-261-12/+10
| | | | | | | * file.c (file_expand_path): use BUFCHECK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): add more space for '/'.usa2008-05-261-1/+6
| | | | | | | | | * file.c (file_expand_path): should reset address of p after calling rb_str_resize(). [ruby-dev:34800] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (ntfs_tail): filename which starts with '.' is valid.usa2008-05-261-1/+2
| | | | | | | | * file.c (file_expand_path): cygwin symlink support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): fix for short file name on Cygwin.nobu2008-05-171-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_extname): first dot is not an extension name.nobu2008-05-171-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): support for alternative data streamnobu2008-05-151-25/+182
| | | | | | | | | | | and ignored trailing garbages of NTFS. * file.c (rb_file_s_basename): ditto. * file.c (rb_file_s_extname): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_find_file_ext): guard load_path from GC.akr2008-05-081-0/+1
| | | | | | | | | gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) optimizes load_path by holding only RARRAY_LEN(load_path) and RARRAY_PTR(load_path) in registers on IA64 GNU/Linux Etch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c (dln_find_exe_r, dln_find_file_r): reentrant versions.nobu2008-05-071-2/+4
| | | | | | | | | * file.c (rb_find_file_ext, rb_find_file), process.c (proc_exec_v), (rb_proc_exec, proc_spawn_v, proc_spawn), ruby.c (process_options): use reentrant versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * load.c (rb_load_path), vm_core.h (rb_vm_t): moved to VM.nobu2008-04-301-11/+11
| | | | | | | | | | | | | | * load.c (rb_get_load_path): returns absolute load path. * load.c (load_path_getter): $LOAD_PATH getter. * file.c (rb_find_file_ext, rb_find_file), ruby.c (push_include, ruby_init_loadpath): use the accessor. * vm.c (rb_vm_mark): mark load_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (eaccess): workaround for recent msvcrt's behavior.usa2008-04-221-2/+2
| | | | | | | | [ruby-core:16460] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): constified.nobu2008-04-201-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (SET_EXTERNAL_ENCODING): avoid call rb_enc_check() onmatz2008-04-141-2/+1
| | | | | | half-baked result string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (file_expand_path): set external encoding.nobu2008-04-111-1/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_basename, rb_file_s_dirname, rb_file_s_extname):nobu2008-04-111-0/+3
| | | | | | | copy encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (isdirsep): backslash is valid path separator on cygwin too.nobu2008-03-081-7/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_flock): returns false on EAGAIN if non-blocking.nobu2008-03-051-2/+1
| | | | | | | [ruby-core:15795] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_flock): immediately returns on EAGAIN ifnobu2008-02-281-2/+4
| | | | | | | non-blocking. [ruby-core:15672] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (ftruncate): check if available.nobu2008-02-141-1/+1
| | | | | | | * file.c (rb_file_truncate): check if ftruncate instead of truncate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_s_utime): inhibits with secure level 2 or higher.nobu2008-02-141-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (lchmod_internal): fix warning cast from pointer to integer ofnaruse2008-02-081-1/+1
| | | | | | different size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_usascii_new{,2}: defined.naruse2008-01-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when empty string. * encoding.c (rb_usascii_encoding, rb_usascii_encindex): defined. (rb_enc_inspect, enc_name, rb_locale_charmap, rb_enc_name_list_i): use rb_str_ascii_new. * array.c (recursive_join, inspect_ary): ditto. * object.c (nil_to_s, nil_inspect, true_to_s, false_to_s, rb_mod_to_s): ditto. * hash.c (inspect_hash, rb_hash_inspect, rb_f_getenv, env_fetch, env_clear, env_to_s, env_inspect): ditto. * numeric.c (flo_to_s, int_chr, rb_fix2str): ditto. * bignum.c (rb_big2str): ditto. * file.c (rb_file_ftype, rb_file_s_dirname, rb_file_s_extname, file_inspect_join, Init_file): ditto. * test/ruby/test_ruby_m17n.rb: add checks for encoding of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (sys_fail2): get rid of unlimited alloca.nobu2008-01-161-3/+23
| | | | | | | * io.c (mode_enc, pipe_open, rb_io_s_popen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_isascii): defined.akr2008-01-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/st.h (st_strcasecmp): declared. (st_strncasecmp): ditto. * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp. (st_strcasecmp): defined. (st_strncasecmp): ditto. * include/ruby/ruby.h: include include/ruby/encoding.h. (ISASCII): use rb_isascii. (ISPRINT): use rb_isprint. (ISSPACE): use rb_isspace. (ISUPPER): use rb_isupper. (ISLOWER): use rb_islower. (ISALNUM): use rb_isalnum. (ISALPHA): use rb_isalpha. (ISDIGIT): use rb_isdigit. (ISXDIGIT): use rb_isxdigit. (TOUPPER): defined. (TOLOWER): ditto. (STRCASECMP): ditto. (STRNCASECMP): ditto. * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c, transcode.c, ext/readline/readline.c: use locale insensitive functions. [ruby-core:14662] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (Init_File): File.exists? revived.matz2007-12-211-1/+3
| | | | | | * dir.c (Init_Dir): Dir.exists? again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c, regerror.c, string.c, parse.y, ruby.c, file.c:akr2007-12-121-1/+1
| | | | | | | | use capital letter for \xHH notation. [ruby-dev:32511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_expr_str): use \xHH instead of \OOO.akr2007-12-091-1/+1
| | | | | | | | | | | | | | | | | | * regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e