Commit graph

274 commits

Author SHA1 Message Date
nobu
f3925d5ae0 * file.c (rb_path_end): skip root directory. fixed: [ruby-core:08913]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-25 12:25:29 +00:00
nobu
f335958500 * file.c (path_check_0, fpath_check): disable path check on cygwin.
[ruby-talk:213074]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-07 14:28:36 +00:00
nobu
401ff253ef * file.c (path_check_0): check if sticky bit is set on parent
directories for executable path.  fixed: [ruby-dev:29415]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 20:50:13 +00:00
drbrain
696a5a0572 Fix documentation submitted by Rick Ohnemus. ruby-Bugs-5529. [ruby-core:08725]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-27 22:30:48 +00:00
nobu
f1e332beb5 * file.c (rb_file_s_rename): use errno if set properly.
fixed: [ruby-dev:29293]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-19 02:29:18 +00:00
nobu
55988fddc2 * file.c (rb_stat_[rRwWxX]): check for super user.
fixed: [ruby-core:08616]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-17 10:15:55 +00:00
matz
980326f6f1 * ruby.h: export classes/modules to implement sandbox.
[ruby-core:08283]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-20 07:04:17 +00:00
eban
9e58e4a5e7 * file.c (cygwin_flock): save old errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-06 07:13:53 +00:00
eban
1e34639d38 * file.c (rb_thread_flock): ERROR_NOT_LOCKED is not an error on Cygwin.
In such situation, flock() should return 0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-06 07:06:22 +00:00
nobu
3da2897dc0 * configure.in, dln.c, file.c, intern.h, missing.h (eaccess): use
system routine if provided.  fixed: [ruby-core:07195]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-25 13:30:11 +00:00
ocean
8190c93409 * file.c (rb_file_s_chmod): avoid warning where sizeof(int) !=
sizeof(void*).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-13 18:44:34 +00:00
usa
34664e81af * file.c (eaccess): workaround for VC++8 runtime.
* win32/win32.c (ioinfo): VC++8 support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 19:55:58 +00:00
akr
35d8b850a3 (rb_f_test): fix document. [ruby-dev:28087]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-21 09:20:15 +00:00
ocean
dc2f377889 * file.c (w32_io_info): should return handle because FileIndex is
valid only while file is open. [ruby-dev:28088]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-21 07:53:55 +00:00
ocean
4126b8742f * file.c (w32_io_info): CreateFile failed on Win9x if file was already
opened. (FILE_SHARE_READ was needed, but actually I don't understand
  the flags of CreateFile well...)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-23 16:32:47 +00:00
ocean
ce4cda9de5 * file.c (w32_io_info): should not call GetFileInformationByHandle
for pipe.

* file.c (w32_io_info): checks return value from rb_w32_get_osfhandle.

* file.c (w32_io_info): now can identify directory on WinNT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-23 09:56:23 +00:00
ocean
2cb3480d22 * intern.h, file.c: failed to compile on windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-23 02:06:00 +00:00
nobu
fff3548e04 * file.c (test_identical): test if two files are identical.
* file.c (rb_f_test): support DOSISH systems where st_ino is not
  reliable.  fixed: [ruby-core:06672]

* win32.h, win32.c (rb_w32_osid): check the running platform.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 16:26:39 +00:00
usa
a696d9ad0c * file.c (rb_file_s_basename): skip slashes just after UNC top slashes.
* test/ruby/test_path.rb (test_dirname, test_basename): follow new
  spec. and add new tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 05:48:51 +00:00
nobu
f8dd75cbcc * file.c (rb_file_s_basename): DOSISH_UNC is defined on cygwin but
DOSISH is not.  fixed: [ruby-dev:27797]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-21 16:47:13 +00:00
nobu
c49ad1c40d * file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path
should not be splitted.  fixed: [ruby-dev:27776] [ruby-dev:27786]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-21 13:21:47 +00:00
usa
63fe6ca5a0 * file.c (rb_file_s_dirname): should use skipprefix for UNC path.
pointed out by nobu ([ruby-dev:27744]). fixed: [ruby-core:5076]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-18 09:09:25 +00:00
usa
147dcb2236 * file.c (file_s_dirname): added checks for some patterns with drive
letter. fixed: [ruby-dev:27738]

* test/ruby/test_path.rb (test_dirname): added tests for above
  patterns.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-18 08:27:52 +00:00
nobu
b750e49434 * file.c (rb_file_s_readlink): ERANGE will occur only on GPFS.
[ruby-dev:27699]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-14 14:52:55 +00:00
ocean
fa9a6a96e1 * configure.in: undef HAVE_LINK on BeOS. (link(2) always returns
EINVAL, and this causes error in test/fileutils.)

* file.c: overwride chown(2) and fchown(2) on BeOS. (these functions
  should not change user/group id if -1 is passed as corresponding
  argument, and this causes error in test/fileutils too)
  [ruby-dev:27672]

* file.c (rb_file_s_link): checks HAVE_LINK.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-10 22:48:43 +00:00
nobu
6609fbb02b * file.c (rb_file_s_readlink): readlink(2) on AIX fails with ERANGE if
buffer size is less than required.  fixed: [ruby-dev:27634]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-06 11:18:57 +00:00
nobu
aa9c627fd2 * file.c (rb_file_join): elements may contain null pointer strings.
report and fixed by Lloyd Zusman (hippoman): [ruby-core:06326]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-18 23:29:24 +00:00
usa
048443c1c8 * file.c (chmod_internal, lchmod_internal): fixed type of 2nd argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-17 07:06:53 +00:00
eban
4239dc8dee * file.c (rb_f_test): typos in RDoc comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-12 02:26:52 +00:00
eban
0a7a3a465d * file.c (rb_f_test): typo in RDoc comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-12 02:14:50 +00:00
nobu
e594bf57d8 * class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
  re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
  undocumented.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-28 14:42:46 +00:00
nobu
1141f008a8 * file.c (apply2files): add prototype.
* file.c (rb_stat_inspect): constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-28 14:41:58 +00:00
matz
52f59d78f2 * file.c (fpath_check): typo fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-20 17:51:20 +00:00
matz
cca26c2226 * file.c (path_check_0): disallow sticky world writable directory
in PATH (and $LOAD_PATH).  [ruby-dev:27226]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-20 17:44:57 +00:00
aamine
5101be8a51 * file.c (rb_file_chown): should accept nil. [ruby-dev:27171] (backport from trunk, rev 1.208)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-19 10:09:53 +00:00
akr
5b2eef31aa * file.c (rb_thread_flock): wrap the flock system call by
TRAP_BEG/TRAP_END to enable signals.  [ruby-dev:27122]

* ext/socket/socket.c (bsock_send): wrap the sendto and send system
  call by TRAP_BEG/TRAP_END to enable signals when writing to a socket
  which is full.  [ruby-dev:27132]

* io.c (rb_io_syswrite): wrap the write system call by
  TRAP_BEG/TRAP_END to enable signals when writing to a pipe which is
  full.  [ruby-dev:27134]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-18 18:22:44 +00:00
nobu
6291abe61e * file.c (file_inspect_join): commit miss, applied a patch for old trunk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-16 13:50:18 +00:00
nobu
4b66a13082 * file.c (file_inspect_join): missing argument declaration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-16 13:43:41 +00:00
nobu
a2bb19fa9f * file.c (rb_file_s_extname): empty string for path name ending with a
period.  fixed: [ruby-core:05651]

* file.c (rb_file_join): smarter behavior at edge cases.
  fixed: [ruby-core:05706]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-16 13:42:17 +00:00
eban
9d7f33e08b * dir.c, file.c (lstat): avoid warnings for mingw.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-11 13:30:10 +00:00
akr
ed861a0c78 typo fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-02 12:38:23 +00:00
matz
125514995c * dir.c (dir_open_dir): new function. [ruby-dev:25242]
* hash.c (Init_Hash): remove custom "hash" and "eql?".

* lib/set.rb (Set::eql): wrong definition.  [ruby-dev:25207]

* object.c (rb_obj_id_obsolete): warn always.

* eval.c (rb_enable_super): ditto.

* lib/set.rb (Set#==): [ruby-dev:25206]

* lib/pstore.rb (PStore#transaction): Use the empty content when a
  file is not found.  [ruby-dev:24561]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-18 02:07:31 +00:00
matz
4e979c77e5 * file.c (rb_file_chown): [ruby-dev:24949]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-22 17:02:45 +00:00
matz
39080991ab * file.c (rb_file_chown): integer conversion should be prior to
GetOpenFile().  [ruby-dev:24947]

* file.c (rb_file_truncate): ditto.

* file.c (rb_file_s_truncate): ditto.

* dir.c (dir_seek): use NUM2OFFT().

* misc/ruby-mode.el (ruby-non-block-do-re): [ruby-core:03719]

* dir.c (dir_seek): should retrieve dir_data after NUM2INT().
  [ruby-dev:24941]

* string.c (rb_str_splice): should place index wrapping after
  possible modification.  [ruby-dev:24940]

* eval.c (error_print): nicer traceback at interrupt.
  [ruby-core:03774]

* string.c (str_gsub): internal buffer should not be listed by
  ObjectSpace.each_object() by String#gsub.  [ruby-dev:24931]

* lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise
  exception if data corresponding to session specified from the
  client does not exist.

* string.c (str_gsub): internal buffer should not be listed by
  ObjectSpace.each_object().  [ruby-dev:24919]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-22 15:29:52 +00:00
nobu
99be646a7f * io.c (rb_io_check_initialized): new function to check uninitialized
object.  [ruby-talk:118234]

* file.c (rb_file_path), io.c (rb_io_closed): check if initialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-29 12:28:32 +00:00
nobu
3b6dac4e1d * eval.c (rb_load, search_required, rb_require_safe, rb_require): use
frozen shared string to avoid outside modification.  [ruby-dev:24580]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-23 15:41:17 +00:00
nobu
bf71c226fc * file.c (rb_file_truncate): discard read buffer before truncation.
[ruby-dev:24197]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-17 22:26:58 +00:00
matz
6f9dcadf6e * string.c (rb_str_sum): check was done with false pointer.
[ruby-dev:24383]

* string.c (rb_str_sum): string may be altered.  [ruby-dev:24381]

* eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe
  sourcefile string modification.  [ruby-dev:24373]

* io.c (io_read): block string buffer modification during
  rb_io_fread() by freezing it temporarily. [ruby-dev:24366]

* io.c (rb_io_s_popen): mode argument may be altered.
  [ruby-dev:24375]

* file.c (rb_file_s_basename): ext argument may be altered.
  [ruby-dev:24377]

* enum.c (enum_sort_by): use NODE instead of 2 element arrays.
  [ruby-dev:24378]

* string.c (rb_str_chomp_bang): StringValue() may change the
  receiver.  [ruby-dev:24371]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-02 03:50:53 +00:00
matz
de5a85496a * array.c (rb_ary_equal): element size might change during
comparison.  [ruby-dev:24254]

* array.c (rb_ary_diff): ditto. [ruby-dev:24274]

* array.c (rb_ary_select): ditto. [ruby-dev:24278]

* array.c (rb_ary_delete): ditto. [ruby-dev:24283]

* array.c (rb_ary_rindex): ditto. [ruby-dev:24275]

* array.c (rb_ary_initialize): element size might change during
  initializing block.  [ruby-dev:24284]

* dir.c (dir_s_chdir): avoid memory leak and unnecessary chdir to
  the original directory when exception has caused in changing
  direcotry or within block.  thanks to Johan Holmberg
  <holmberg@iar.se> [ruby-core:03446]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-18 06:56:38 +00:00
matz
e98d5d4f66 * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.
[ruby-talk:106657]  The solution was found by Guy Decoux.

* file.c (rb_stat_dev_major): new methods File::Stat#dev_major and
  #dev_minor. [ruby-core:03195]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-17 02:23:52 +00:00