At Thu, 12 Oct 2000 02:25:09 +0900, Hugh Sasse Staff Elec Eng <hgs / dmu.ac.uk> wrote: > > brains hgs 33 %> ruby -v -e 'File.expand_path("finder.rb", nil)' > ruby 1.6.1 (2000-09-27) [sparc-solaris2.5.1] > -e:1:in `expand_path': failed to convert nil into String (TypeError) > from -e:1 1.4.6 doesn't work either. i think the problem is implicit expectation of string when arg = 2. this patch works for me but not sure it's the right way. -- yashi
Index: file.c =================================================================== RCS file: /home/cvsroot/ruby/file.c,v retrieving revision 1.38 diff -u -u -r1.38 file.c --- file.c 2000/10/10 07:03:17 1.38 +++ file.c 2000/10/11 20:44:28 @@ -1260,7 +1260,7 @@ } #endif else if (!isdirsep(*s)) { - if (argc == 2) { + if (argc == 2 && !NIL_P(dname)) { dname = rb_file_s_expand_path(1, &dname); if (OBJ_TAINTED(dname)) tainted = 1; strcpy(buf, RSTRING(dname)->ptr);