summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/file.c b/file.c
index 9996423dd3..c3828b7175 100644
--- a/file.c
+++ b/file.c
@@ -1755,6 +1755,7 @@ rb_file_s_basename(argc, argv)
if (NIL_P(fext) || !(f = rmext(p, ext))) {
f = chompdirsep(p) - p;
}
+ basename = rb_str_new(p, f);
}
basename = rb_str_new(p, f);
OBJ_INFECT(basename, fname);