summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index abbae82e44..3e0ff4c8fa 100644
--- a/file.c
+++ b/file.c
@@ -1260,7 +1260,7 @@ rb_file_s_expand_path(argc, argv)
}
#endif
else if (!isdirsep(*s)) {
- if (argc == 2) {
+ if (!NIL_P(dname)) {
dname = rb_file_s_expand_path(1, &dname);
if (OBJ_TAINTED(dname)) tainted = 1;
strcpy(buf, RSTRING(dname)->ptr);