summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-12 07:48:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-12 07:48:31 +0000
commit2bc48ec00f2ee0028c1a5096aa676391820b87ec (patch)
treef89e9e7746e75343a2886ee50fc23a37f9fe5886 /file.c
parentce6c53d24d361f589169ffa49360e93be8c994a3 (diff)
downloadruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.tar.gz
ruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.tar.xz
ruby-2bc48ec00f2ee0028c1a5096aa676391820b87ec.zip
2000-06-12
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/file.c b/file.c
index 816277049..29cea5471 100644
--- a/file.c
+++ b/file.c
@@ -1330,9 +1330,9 @@ rb_file_s_basename(argc, argv)
name = STR2CSTR(fname);
p = strrchr(name, '/');
if (!p) {
- if (NIL_P(fext) || !(f = rmext(p, ext)))
+ if (NIL_P(fext) || !(f = rmext(name, ext)))
return fname;
- basename = rb_str_new(p, f);
+ basename = rb_str_new(name, f);
}
else {
p++; /* skip last `/' */
@@ -1696,7 +1696,6 @@ rb_stat_l(obj)
{
#ifdef S_ISLNK
if (S_ISLNK(get_stat(obj)->st_mode)) return Qtrue;
-
#endif
return Qfalse;
}
@@ -1931,7 +1930,7 @@ rb_stat_sticky(obj)
#ifdef S_ISVTX
if (get_stat(obj)->st_mode & S_ISVTX) return Qtrue;
#endif
- return Qnil;
+ return Qfalse;
}
static VALUE rb_mConst;