Commit graph

251 commits

Author SHA1 Message Date
shyouhei
fb5c60ddbe Thu, 29 Jul 2010 23:33:21 +0000 nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
merge revision(s) 28794:28796:
 
 	* file.c (file_expand_path): should check if could find user.
 	  [ruby-core:31538]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

	* file.c (file_expand_path): home directory must be absolute.
	  [ruby-core:31537]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@29859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22 07:21:56 +00:00
shyouhei
d5e7bf424e Fri, 2 Jul 2010 14:35:10 +0000 usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
merge revision(s) 28525:28568:
 
 	* 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/branches/ruby_1_8@28526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

merge from trunk (r28565)

	* file.c (ruby_find_basename): set correct baselen.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>

merge from trunk (r28565)

	* file.c (ruby_find_basename): set correct baselen.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org>



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@29855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22 07:21:34 +00:00
shyouhei
e3947edd23 merge revision(s) 27404:
* file.c (rb_file_s_extname): skip last directory separators.
	  [ruby-core:29627]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-08 06:41:19 +00:00
shyouhei
e3ba58bb2c merge revision(s) 23306:
* 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/branches/ruby_1_8_7@24114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15 02:50:57 +00:00
shyouhei
64e8148bee merge revision(s) 22812:
* file.c: include fcntl.h for O_RDONLY on Solaris.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-03 12:17:29 +00:00
shyouhei
7a5eaffefd merge revision(s) 22392:22394:
* file.c (rb_file_s_extname): fix for spaces before extention.
	  [ruby-dev:38044]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26 12:20:27 +00:00
shyouhei
e6f839c47c merge revision(s) 22654:22661:
* file.c (file_load_ok): checks if regular file, except for the
	  platform disallows to open directories, e.g. dosish.
	  [ruby-dev:38097], [Bug #1221]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 08:44:31 +00:00
shyouhei
63a3507c60 merge revision(s) 17916:
* file.c (rb_file_s_extname): fix for file name with spaces.
	  [ruby-talk:307404]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10 09:47:31 +00:00
knu
d15312360e * file.c (file_expand_path): no need to expand root path which has no
short file name.  [ruby-dev:35095]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-17 06:10:23 +00:00
knu
2b785b0f3e Merge changes from ruby_1_8 to reduce warnings and potentially improve
security.

* mkconfig.rb: hide build path from rbconfig.rb.

* util.c (ruby_strtod, dtoa): initialize more variables for error
  handling.

* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
  (path2class, path2module): constified.

* pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.

* suppress warnings on cygwin, mingw and mswin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 10:39:57 +00:00
knu
23a434b363 * file.c (file_expand_path): fix for non-existent files and SFN of
symlinks.  [ruby-talk:303736]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 10:30:23 +00:00
knu
f072d4e34a Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 11:44:49 +00:00
knu
c4f26e46db Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 10:07:07 +00:00
knu
b524523217 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 17:27:56 +00:00
knu
8480bcc8d5 Merge -r16241:16456 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-18 15:02:36 +00:00
knu
a47dfe2763 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 17:29:39 +00:00
nobu
9cee075559 * rubyio.h (rb_io_t): renamed from OpenFile.
* ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
  ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
  ext/socket/socket.c: ditto.

* win32/win32.h: removed workaround for OpenFile.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 03:35:55 +00:00
nobu
613ad45042 * file.c (isdirsep): backslash is valid path separator on cygwin too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-08 09:51:00 +00:00
nobu
9e8badfc59 * configure.in (ftruncate): check if available.
* file.c (rb_file_truncate): check if ftruncate instead of truncate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 17:42:27 +00:00
nobu
7864d891e2 * file.c (rb_file_s_utime): inhibits with secure level 2 or higher.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 07:02:54 +00:00
nobu
ac56065357 * configure.in (group_member): check if presents.
* configure.in (XCFLAGS): add _GNU_SOURCE on linux.

* file.c (group_member): use system routine if available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 04:10:59 +00:00
nobu
60e3b1b441 * file.c (rb_file_s_rename): deleted code to get rid of a bug of
old Cygwin.

* file.c (rb_file_truncate): added prototype of GetLastError()
  on cygwin.  [ruby-dev:31239]

* intern.h (is_ruby_native_thread): prototype.

* missing/strftime.c (strftime): fix printf format and actual
  arguments.

* ext/Win32API/Win32API.c (Win32API_initialize): ditto.

* ext/tk/tcltklib.c (ip_finalize): ditto.

* ext/dl/ptr.c (rb_dlptr_inspect): ditto.  [ruby-dev:31268]

* ext/dl/sym.c (rb_dlsym_inspect): ditto.

* ext/socket/getnameinfo.c: include stdio.h always.

* ext/win32ole/win32ole.c (ole_hresult2msg, folevariable_name,
  folevariable_ole_type, folevariable_ole_type_detail,
  folevariable_value, folemethod_visible): missing return value.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-22 05:33:47 +00:00
nobu
d33cc535c3 * node.h (struct rb_thread.locals): explicit as struct.
[ruby-core:10585]

* eval.c, node.h (enum rb_thread_status, struct rb_thread,
  rb_curr_thread, rb_main_thread): prefixed.  [ruby-core:10586]

* file.c (chompdirsep): made an unprefixed name static.

* io.c (io_fread): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-24 14:40:08 +00:00
nobu
a30657e815 * file.c (rb_stat_s_utime): fixed a commit miss for the platforms
where utimes() does not exist.

* lib/fileutils.rb (touch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-04 14:38:02 +00:00
nobu
566b460705 * file.c (rb_file_s_utime): allow nil to set the current time.
* lib/fileutils.rb (touch): ditto, and added :mtime and :nocreate
  options.  fixed: [ruby-talk:219037]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-03 13:37:02 +00:00
usa
d158c31683 * file.c (rb_find_file): should not call fpath_check() with NULL.
fixed: [ruby-core:09867]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-09 08:48:03 +00:00
matz
10ec337f53 * file.c (test_grpowned, rb_stat_grpowned): should honor
supplementary group IDs.  [ruby-core:09546]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-22 08:37:11 +00:00
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