summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io
diff options
context:
space:
mode:
author窪山 翔士 <[email protected]>2017-12-12 17:29:05 +0900
committer窪山 翔士 <[email protected]>2017-12-12 17:29:05 +0900
commite71a6a7b2c8a7217a7efd35f74782d4a2c058cda (patch)
treedea5c29bba2e3f5833d7c9ed8b0a13dd8987b5f6 /mrbgems/mruby-io
parent9c0426c990859ecd7a68ebd886d002fe05699a57 (diff)
downloadmruby-e71a6a7b2c8a7217a7efd35f74782d4a2c058cda.tar.gz
mruby-e71a6a7b2c8a7217a7efd35f74782d4a2c058cda.zip
fixed mruby-io so that the test passes on cygwin
Diffstat (limited to 'mrbgems/mruby-io')
-rw-r--r--mrbgems/mruby-io/src/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c
index 19603c856..17fdeeed5 100644
--- a/mrbgems/mruby-io/src/file.c
+++ b/mrbgems/mruby-io/src/file.c
@@ -200,6 +200,7 @@ mrb_file_basename(mrb_state *mrb, mrb_value klass)
if ((bname = basename(path)) == NULL) {
mrb_sys_fail(mrb, "basename");
}
+ if (strncmp(bname, "//", 3) == 0) bname[1] = '\0'; /* patch for Cygwin */
return mrb_str_new_cstr(mrb, bname);
#endif
}