summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 6ed53af..2f38e35 100644
--- a/dir.c
+++ b/dir.c
@@ -1080,9 +1080,8 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path = Qnil;
- if (rb_scan_args(argc, argv, "01", &path) == 1) {
- FilePathValue(path);
- path = rb_str_encode_ospath(path);
+ if (rb_check_arity(argc, 0, 1) == 1) {
+ path = rb_str_encode_ospath(rb_get_path(argv[0]));
}
else {
const char *dist = getenv("HOME");