Граф коммитов

504 Коммитов

Автор SHA1 Сообщение Дата
nobu 4ab39d2202 * file.c (rb_file_flock): use rb_thread_io_blocking_region for the
time being.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-20 07:22:57 +00:00
kosaki 18c11392af * file.c (w32_io_info): get rid of too huge alloca().
[Bug #4313] [ruby-core:34830]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 09:35:56 +00:00
nobu 1b00c45dc0 * file.c (file_expand_path): get rid of warnings caused by
-Wdeclaration-after-statement on cygwin.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26 13:24:17 +00:00
akr 53360bd50a * file.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13 03:01:12 +00:00
kazu 9208951d33 fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06 10:01:48 +00:00
naruse 1346b84c19 NTFS's ctime is creation time! [ruby-core:33269]
Note that UFS2, HFS+, ZFS, and ext4 also have birth time.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-20 19:38:42 +00:00
nobu 41cae1744f * file.c (file_expand_path): use cygwin_conv_path on cygwin 1.7 or
later.
* ruby.c (push_include_cygwin): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11 12:24:41 +00:00
nobu ba8dc58ebb * file.c (NUM2DEVT, DEVT2NUM, PRI_DEVT_PREFIX): fallback to
unsigned int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15 14:36:28 +00:00
nobu a45936d454 * configure.in (dev_t): use RUBY_REPLACE_TYPE.
* file.c (rb_stat_inspect): use PRI_DEVT_PREFIX.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15 11:30:33 +00:00
naruse 694826d7e2 Refix for r29493; it is unsigned.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-14 00:09:07 +00:00
naruse 51427700cc * file.c (DEVT2NUM): added. Size of dev_t is depend on the
environment even if POSIX defines dev_t as unsigned integer.
  For example, OpenVMS, 64bit Solaris 9, and NetBSD 6 defines
  dev_t as 64bit unsigned integer.

* file.c (rb_stat_dev): use DEVT2NUM.

* file.c (rb_stat_dev_major): dev_t is not long. major(3)'s return
  value is int.

* file.c (rb_stat_dev_minor): dev_t is not long. minor(3)'s return
  value is int.

* configure.in: check size of dev_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 23:09:56 +00:00
nobu 0fd37b09ee * file.c (rb_file_s_readlink): symlink target should be in
filesystem encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-04 14:48:55 +00:00
nobu d2da9597c3 * file.c (rb_get_path_check): clarify error message for
ASCII-incompatible path name.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29 14:25:23 +00:00
nobu 909477ec1d * file.c (null_device): move from io.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-27 06:26:41 +00:00
nobu 8aa6059dbf * file.c (realpath_rec): rb_str_modify depends on the length, so
resize instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-06 09:59:31 +00:00
akr a2ebc53ec4 * file.c (realpath_rec): call rb_str_modify before rb_str_set_len.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-04 21:44:20 +00:00
usa 49e259ec58 * file.c (file_expand_path): wrong condition. [ruby-core:31591]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-02 03:25:12 +00:00
nobu 47fd9eb6e1 * file.c (file_expand_path): suppress a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-30 07:06:51 +00:00
nobu 6d56e80ad1 * file.c (file_expand_path): home directory must be absolute.
[ruby-core:31537]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29 23:51:53 +00:00
nobu a99de84663 * file.c (file_expand_path): should check if could find user.
[ruby-core:31538]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-29 23:33:21 +00:00
nobu b67ecc80df * file.c (rb_file_s_basename): pass baselen to rmext.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-28 20:52:16 +00:00
naruse 7175a9073e * class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
clean unused-value warnings.

* cont.c, process.c, vm_exec.h: clean cast warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27 07:13:43 +00:00
nobu 25b9eb5e57 * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
add parent member.

* error.c (rb_typeddata_inherited_p): new function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18 07:31:54 +00:00
usa 09e1383bcf * file.c (ruby_find_basename): set correct baselen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07 04:22:30 +00:00
usa 2520f3f79c * file.c (ruby_find_basename): should initialize f.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07 03:03:19 +00:00
usa 09ee12bb20 * io.c (argf_inplace_mode_set): prohibits an assignment of a tainted
value.

* file.c (ruby_find_basename, ruby_find_extname): split from
  rb_file_s_basename() and rb_file_s_extname().

* util.c (ruby_add_suffix): support arbitrary length of the suffix
  to get rid of the potential buffer overflow.
  reported by tarui.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-02 14:31:26 +00:00
usa e2f4729d42 * file.c (rb_realpath_internal, realpath_rec): skip UNC share root
on DOSISH platforms.
  http://pc12.2ch.net/test/read.cgi/tech/1272248179/600


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-29 05:20:06 +00:00
usa 4df965f4ed * file.c (rb_str_encode_ospath): when the encoding of the parameter
is ASCII-8BIT, should recognize as filesystem encoding, and convert
  to UTF-8 on Windows.

* file.c (realpath_rec): should convert to ospath encoding before
  calling lstat().

* file.c (rb_realpath_internal): resolved string should take over
  the encoding of base string.

* transcode.c (rb_str_encode): should return new string always.
  fixed #3444.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17 09:46:30 +00:00
nobu 45815f9c9d * file.c (rb_f_test): 'W' should test writable by real uid/git,
not world writable.   [ruby-core:30587]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-04 23:30:48 +00:00
naruse 455554b64c * file.c (file_expand_path): Refix r28102: this breaks
r28039. test for [ruby-dev:41429] is added. [ruby-core:30516]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31 08:47:08 +00:00
nobu b5cd43c998 * file.c (file_expand_path): check if expanded dname encoding is
compatible with fname, not just copying.  [ruby-core:30516]

* test/ruby/test_beginendblock.rb (test_endblockwarn): needs
  encoding comment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30 19:03:47 +00:00
mame 59c74fab79 * file.c (rb_file_directory_p): update rdoc. a patch from Ilkka
Laukkanen.  [ruby-core:30016]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30 08:10:04 +00:00
nobu 45f6fbf339 * removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
naruse 97c175fa19 * file.c (rb_home_dir): set filesystem encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-27 14:47:29 +00:00
naruse 84abef0fc0 * file.c (file_expand_path): set encoding as the same of fname
when _result_ is not filesystem encoding. [ruby-dev:41429]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-27 14:47:23 +00:00
naruse ac8346c4c3 * file.c (file_expand_path): use rb_enc_associate_index and
rb_filesystem_encindex. Strings related FileSystem should
  have filesystem_encoding.

* file.c (SET_EXTERNAL_ENCODING): removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-27 14:47:20 +00:00
usa fd8a1c725b * file.c (file_expand_path): revert a part of r22392. it's commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-26 11:04:43 +00:00
marcandre c5b5ab0935 * enum.c: Documentation: small fixes
* file.c: ditto

* io.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:51:01 +00:00
marcandre c1ecff1b1e * hash.c: Documentation: change => in call-seq to ->.
* enum.c: Documentation: whitespace fix for r27865

* error.c: ditto

* file.c: ditto

* io.c: ditto

* load.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:31:22 +00:00
marcandre 7729de4d91 * array.c: Documentation: change => in call-seq to ->.
Harmonize "#=>" in examples. [ruby-core:30206]

* bignum.c: ditto

* class.c: ditto

* compar.c: ditto

* cont.c: ditto

* dir.c: ditto

* encoding.c: ditto

* enum.c: ditto

* enumerator.c: ditto

* error.c: ditto

* eval.c: ditto

* file.c: ditto

* gc.c: ditto

* io.c: ditto

* load.c: ditto

* marshal.c: ditto

* math.c: ditto

* numeric.c: ditto

* object.c: ditto

* pack.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* range.c: ditto

* re.c: ditto

* ruby.c: ditto

* signal.c: ditto

* sprintf.c: ditto

* string.c: ditto

* struct.c: ditto

* thread.c: ditto

* time.c: ditto

* transcode.c: ditto

* variable.c: ditto

* vm_eval.c: ditto

* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:07:33 +00:00
usa 54062a76e7 * file.c (rb_stat): use STAT macro instead of calling stat() directly.
reported by Bill Kelly.  [ruby-core:30012]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05 06:55:45 +00:00
nobu 21c5ffc535 * file.c (rb_str_encode_ospath): unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-03 01:46:28 +00:00
usa 6c28f99d88 * merge some patches from win32-uncode-test branch.
see #1685.

* file.c, include/ruby/intern.h (rb_str_encode_ospath): new function
  to convert encoding for pathname.

* win32.c, include/ruby/win32.h (rb_w32_ulink, rb_w32_urename,
  rb_w32_ustati64, rb_w32_uopen, rb_w32_uutime, rb_w32_uchdir,
  rb_w32_umkdir, rb_w32_urmdir, rb_w32_uunlink): new functions to
  accept UTF-8 path.

* win32/win32.c (rb_w32_opendir, link, rb_w32_stati64, rb_w32_utime,
  rb_w32_unlink): use WCHAR path internally.

* file.c (rb_stat, eaccess, access_internal, rb_file_s_ftype,
  chmod_internal, rb_file_chmod, rb_file_chown, utime_internal,
  rb_file_s_link, unlink_internal, rb_file_s_rename): use UTF-8 version
  functions on Win32.

* file.c (apply2files, rb_stat, rb_file_s_lstat, rb_file_symlink_p,
  rb_file_readable_p, rb_file_writable_p, rb_file_executable_p,
  check3rdbyte, rb_file_identical_p, rb_file_chmod, rb_file_chown,
  rb_file_s_link, rb_file_s_symlink, rb_file_s_rename): call
  rb_str_encode_ospath() before passing the path to system.

* io.c (rb_sysopen): ditto.

* dir.c (dir_chdir, dir_s_mkdir, dir_s_rmdir): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 17:56:23 +00:00
akr c41dc085d0 * file.c (file_expand_path): call rb_str_set_len before BUFCHECK to
prevent rb_str_resize in BUFCHECK discard the content.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 03:06:43 +00:00
marcandre 478c3e080b * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrong
number of arguments

* file.c (rb_f_test, rb_file_s_umask): ditto

* numeric.c (int_chr, num_step): ditto

* process.c (rb_f_sleep): ditto

* re.c (rb_reg_initialize_m): ditto

* signal.c (rb_f_kill, sig_trap): ditto

* string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang,
  rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto

* proc.c (curry): rdoc fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 02:40:57 +00:00
nobu cb508fe739 * file.c (rb_file_s_extname): skip last directory separators.
[ruby-core:29627]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 15:43:05 +00:00
nobu 38af94c6ab * file.c (rb_file_dirname): split from rb_file_s_dirname.
* load.c (rb_f_require_relative): use absolute path instead of
  expanded path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 09:26:09 +00:00
mame e70499732a * file.c (rb_get_path_check): prefer #to_path over #to_str. a patch
originally written by me, and modified by Nobuyoshi Nakada.
  [ruby-core:24257]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-25 14:22:41 +00:00
naruse 152934a300 * file.c (file_expand_path): set length of string before calling
rb_enc_check because rb_enc_check scans its content.
  This prevents warnings by valgrind.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-24 01:25:02 +00:00
mame 6ff75042db * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute
path field into rb_iseq_t.  The field contains a string representing
  a path to corresponding source file. or nil when the iseq is created
  from -e, stdin, eval, etc.  This field is used for require_relative.
  [ruby-dev:40004]

* load.c (rb_f_require_relative): add C implementation of
  require_relative.

* prelude.rb (require_relative): get rid of Ruby implementation of
  require_relative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16 17:40:00 +00:00
nobu b215b9742e * file.c (file_expand_path): ignore dname if it has different
drive letter or UNC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16 02:23:51 +00:00
nobu ae0224673e * file.c (Init_File): do not define File::ALT_SEPARATOR on cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14 22:51:08 +00:00
nobu 71f4f96249 * file.c (realpath_rec): use same cache.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14 22:41:04 +00:00
nobu b24c8e4dd6 * file.c (file_alt_separator): commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14 22:33:09 +00:00
nobu 980a954f11 * file.c (FILE_ALT_SEPARATOR): separated condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14 22:16:12 +00:00
matz 5cff0face3 * file.c (EXPAND_PATH_BUFFER): make it back to usascii, to prevent
infinite loop on some platform. [ruby-dev:40629]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13 22:23:02 +00:00
matz dc6075844d * file.c (file_expand_path): should not just copy the encoding
from fname.  [ruby-core:28635]

* file.c (EXPAND_PATH_BUFFER): set filesystem_encoding, not
  usascii for path buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13 14:50:26 +00:00
shugo d9fe7ef492 * load.c (rb_get_expanded_load_path): does not expand paths if all
the items in $: are absolute paths.  [ruby-core:28113]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13 01:34:38 +00:00
nobu 0884036a0a * file.c (rb_file_s_basename): check encoding of suffix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-12 15:44:24 +00:00
akr 785b31bed4 * file.c: add optional basedir argument for realpath/realdirpath.
(realpath_internal): handle basedir.
  (rb_file_s_realpath): extract basedir from argument list.
  (rb_file_s_realdirpath): extract basedir from argument list.

* lib/pathname.rb (realpath): pass basedir.
  (realdirpath): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-07 04:55:34 +00:00
naruse 8a144fdedc * encoding.c (enc_set_filesystem_encoding):
filesystem encoding on Mac OS X is now
  default external encoding. so Mac OS X is now
  treated as one of Unix. [ruby-dev:40439]

* file.c (file_path_convert): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06 17:11:28 +00:00
nobu 9c45868b41 * file.c (rb_find_file_ext_safe, rb_find_file_safe): skip argument
checks in file_expand_path().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-02 05:29:27 +00:00
akr 792b3efa62 * file.c (rb_group_member): renamed from group_member.
don't use group_member() in glibc because it's not valgrind clean.
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570047


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-16 12:00:24 +00:00
akr 688ca71c13 * file.c (realpath_rec): rb_path_last_separator may return NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03 11:08:44 +00:00
nobu 54e45b30cc * file.c (be_chown, be_fchown, eaccess): suppressed warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25 09:47:11 +00:00
naruse d5b0c4b1f3 * dln.c, file.c, io.c, signal.c: add __HAIKU__.
patched by Alexander von Gluck [ruby-core:27767]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25 03:06:06 +00:00
akr f6f3d1bc0e * string.c (rb_str_set_len): call rb_str_modify.
* file.c (realpath_rec): don't call rb_str_modify before
  rb_str_set_len.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-12 12:56:15 +00:00
akr d60d63ef80 * file.c (realpath_internal): call rb_secure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-12 11:47:03 +00:00
usa 37ce3f6e0d * file.c (realpath_rec): trace symbolic link only when supporting
readline().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-12 04:35:53 +00:00
akr 853dd6cabe * prelude.rb (require_relative): use File.realpath. [ruby-dev:40040]
* 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
2010-01-12 00:32:22 +00:00
akr 3512a38d3b * file.c (rb_f_test): use string form in unknown command error
message.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-07 18:51:42 +00:00
naruse c796b348c6 * file.c (file_path_convert): fix fs_encoding is not assign.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24 01:20:18 +00:00
naruse 07ae16d18c * file.c (file_path_convert): delay getting UTF8-MAC encoding
while really needed. [ruby-core:26807]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-21 05:45:48 +00:00
usa 4bfd133993 * file.c (file_path_convert): delay getting filesystem encoding
while really needed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18 06:28:19 +00:00
naruse 6c2373ea67 * io.c (rb_scan_open_args): move path encoding conversion
for filesystem encoding of Mac OS X.

* file.c (file_path_convert): added for convert encoding
  of file path.

* file.c (rb_get_path_check): add file_path_convert.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18 02:41:25 +00:00
marcandre 705c567194 * string.c: rdoc for <=>, casecmp
* bignum.c: rdoc for <=>

* file.c: ditto

* time.c: ditto

* compar.c: rdoc

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28 04:50:09 +00:00
nobu 89afd642aa * file.c (path_check_0): prevent from GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10 14:57:46 +00:00
usa d70e9a5568 * win32/win32.c, include/ruby/win32.h (rb_w32_access): new function to
replace MSVCRT's access().
  [ruby-core:25761]

* file.c (eaccess): workaround for recent MSVCRT is no longer needed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 07:04:25 +00:00
nobu a1485dbea0 * dir.c (GlobPathValue), file.c (rb_get_path_check): path names
must be ASCII compatible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-19 08:33:01 +00:00
nobu 23c95ef6c7 * file.c (stat_data_type): typed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 03:01:37 +00:00
nobu e07cb859cc * suppressed shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18 08:05:32 +00:00
nobu ca93e00559 * file.c (rb_file_s_basename): returns new string instead of
shared string from FilePathStringValue().  [ruby-core:24199]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-08 07:47:09 +00:00
nobu ae72efc541 * file.c (BUFCHECK): use common bdiff.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29 08:16:19 +00:00
nobu b861b2a6b2 * file.c (file_expand_path): should copy original encoding.
[ruby-dev:38612]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29 08:14:39 +00:00
nobu 8b920b4ac8 * file.c (rb_get_path_check): check with given safe level.
* file.c (rb_find_file_ext_safe, rb_find_file_safe): ditto.

* safe.c (rb_insecure_operation): function to raise security error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-23 12:28:16 +00:00
nobu ff1b8b7593 * file.c (rb_find_file_ext, rb_find_file): no needs to expand
paths with tilde twice.

* load.c (rb_f_load): load the given path directly if not found in
  load_path.

* load.c (search_required): search file in specified safe level.

* load.c (rb_require_safe): path to load is already searched in
  search_required().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-23 07:05:04 +00:00
akr fc64028291 * io.c: remove __CHECKER__ test.
* 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-22 12:23:06 +00:00
nobu 7785612a38 * file.c (file_expand_path): drive letter is ascii only.
[ruby-dev:38612]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17 16:29:22 +00:00
nobu 439ad47eb8 * file.c (rb_find_file_ext, rb_find_file): canonicalize absolute
paths.  [ruby-core:23845]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-14 01:49:23 +00:00
nobu 122018e802 * file.c (rb_file_size): added rdoc. a patch from Run Paint Run
Run at [ruby-core:23839].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-14 01:23:21 +00:00
nobu a860431e3b * file.c (file_expand_path): associate the input encoding when
copying an absolute path.  [ruby-dev:38594]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-12 05:56:53 +00:00
nobu d6d8d973c8 * file.c (istrailinggarbage): fixed typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-31 14:26:40 +00:00
nobu fea2ebff1a * file.c (rb_file_join): recursive array has no meaning as path
name.  [ruby-core:23329]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-29 06:22:29 +00:00
akr 8e8ae2a9c5 * node.h (rb_notimplement_body_p): declared.
* 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 16:58:06 +00:00
akr 8b27d153d2 * class.c (rb_define_method_id): use rb_define_notimplement_method_id
if rb_f_notimplement is given.
  (rb_define_protected_method): ditto.
  (rb_define_private_method): ditto.
  (rb_define_method): use rb_define_method_id.

* include/ruby/intern.h (rb_f_notimplement): declared.
  (rb_define_notimplement_method_id): declared.

* proc.c (method_inspect): show not-implemented.

* vm_method.c (notimplement_body): new variable.
  (rb_notimplement_body_p): new function.
  (rb_method_boundp): return false if not implemented.
  (rb_f_notimplement): new function.
  (rb_define_notimplement_method_id): new function.

* process.c (rb_f_fork): use rb_f_notimplement if not implemented.

* file.c (rb_file_s_lchmod): use rb_f_notimplement if not implemented.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-16 14:17:14 +00:00
nobu 228d3e46a3 * file.c (utime_failed): refined the error message for EINVAL on
DOSISH platforms, where it may fail depending on filesystems.
  see [ruby-dev:38277].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-06 10:26:20 +00:00
nobu a3a88c6bcd * file.c (sys_fail2, rb_file_s_readlink, BUFCHECK, rmext),
(rb_file_s_basename): get rid of overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-06 07:38:52 +00:00
knu 61e6f9b81c * file.c (rb_file_s_lstat): Back out.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 10:22:49 +00:00
knu fe3de995b6 * file.c (rb_file_s_stat, rb_file_s_lstat): Remove repeated type
checks.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 10:00:57 +00:00
nobu b7800329d3 * configure.in (RUBY_CHECK_SIZEOF): allows qualified name.
* configure.in (RUBY_REPLACE_TYPE): checks more strictly.

* configure.in (struct stat.st_size, struct stat.st_blocks),
  (struct stat.st_ino): check for size.

* lib/mkmf.rb (check_sizeof): allows qualified name.

* file.c (rb_stat_ino, rb_stat_blocks): check by size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19 09:49:51 +00:00