Hello,

In message "[ ruby-Bugs-7678 ] Troublesome -T ruby interpret flag"
    on Jan.09,2007 04:38:24, <noreply / rubyforge.org> wrote:
| However, the behavior of -T1 and $SAFE=1 differ slightly, as described below. It may be a non-issue and I'm doing something the Wrong Way(tm), however, the fact that require complains about NULL pointer given itself would suggest otherwise.

There is one difference between -T1 and $SAFE=1.
With -T1 with command line option, ruby removes "." from library
path.
# Attention: -T1 with shebang line does NOT removes ".".
# I think this is improper behavior, but it's spec.

BTW, "NULL pointer given (ArgumentError)" is wrong message.
It should be LoadError.

patch (for 1.8, but it will be needed to apply 1.9, too.)

Index: file.c =================================================================== --- file.c (revision 11518) +++ file.c (working copy) @@ -4341,7 +4341,9 @@ if (!lpath) { return 0; /* no path, no load */ } - f = dln_find_file(f, lpath); + if (!(f = dln_find_file(f, lpath))) { + return 0; + } if (rb_safe_level() >= 1 && !fpath_check(f)) { rb_raise(rb_eSecurityError, "loading from unsafe file %s", f); }
Regards, -- U.Nakamura <usa / garbagecollect.jp>