summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-23 17:06:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-23 17:06:55 +0000
commitbf3cd18a1a4641cf388886863a2f8fa80339b3a8 (patch)
treef33268bec64b1e9cc8b89206923dc950193d0457 /file.c
parent2fc16254a57fc969503a3c17ea016f27d316d751 (diff)
downloadruby-bf3cd18a1a4641cf388886863a2f8fa80339b3a8.tar.gz
ruby-bf3cd18a1a4641cf388886863a2f8fa80339b3a8.tar.xz
ruby-bf3cd18a1a4641cf388886863a2f8fa80339b3a8.zip
* file.c (rb_file_s_expand_path): avoid calling rb_scan_args() for
apparent cases. [ruby-talk:79748] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.c b/file.c
index 223b243fc..3a09b4e62 100644
--- a/file.c
+++ b/file.c
@@ -1758,6 +1758,10 @@ rb_file_s_expand_path(argc, argv)
VALUE *argv;
{
VALUE fname, dname;
+
+ if (argc == 1) {
+ return rb_file_expand_path(argv[0], Qnil);
+ }
rb_scan_args(argc, argv, "11", &fname, &dname);
return rb_file_expand_path(fname, dname);