summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-18 07:47:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-18 07:47:15 +0000
commit992923053cfb51dc04c6a7ee07ca6fff1b61d1a5 (patch)
tree2b2857adc35295dcd45c57c338c440ec16f99eff /file.c
parent16487ee284f17cfbf6fad9f6b2fedc57f0f37e0a (diff)
1.1b9_26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/file.c b/file.c
index 3619e55a29..0feb226d22 100644
--- a/file.c
+++ b/file.c
@@ -705,8 +705,15 @@ file_s_ftype(obj, fname)
struct stat st;
char *t;
+#if defined(MSDOS) || defined(NT)
if (rb_stat(fname, &st) < 0)
+ rb_sys_fail(RSTRIN(fname)->ptr);
+#else
+ Check_SafeStr(fname);
+ if (lstat(RSTRING(fname)->ptr, &st) == -1) {
rb_sys_fail(RSTRING(fname)->ptr);
+ }
+#endif
if (S_ISREG(st.st_mode)) {
t = "file";