summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/file.c b/file.c
index 679a228c3e..103fca2b17 100644
--- a/file.c
+++ b/file.c
@@ -20,11 +20,13 @@
#include <sys/cygwin.h>
#endif
+#define OpenFile rb_io_t
#include "ruby.h"
#include "rubyio.h"
#include "rubysig.h"
#include "util.h"
#include "dln.h"
+#include <ctype.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -2308,6 +2310,8 @@ rb_file_s_umask(argc, argv)
# else
# define CharNext(p) ((p) + 1)
# endif
+#endif
+
#if defined _WIN32 || defined __CYGWIN__
#define USE_NTFS 1
#else
@@ -2320,8 +2324,6 @@ rb_file_s_umask(argc, argv)
#define istrailinggabage(x) 0
#endif
-#endif
-
#ifdef __CYGWIN__
#undef DOSISH
#define DOSISH_UNC
@@ -2921,7 +2923,7 @@ rb_file_s_basename(argc, argv)
if (NIL_P(fext) || !(f = rmext(p, n, StringValueCStr(fext)))) {
f = n;
}
- if (f == RSTRING_LEN(fname)) return fname;
+ if (f == RSTRING(fname)->len) return fname;
}
basename = rb_str_new(p, f);
OBJ_INFECT(basename, fname);