diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-19 07:10:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-19 07:10:09 +0000 |
commit | d887a2fc45b9ccd27cb4c029c30f709f748a910c (patch) | |
tree | f1ad61761e4b28b18e939dd1667981810cc49d4b /file.c | |
parent | 35bc2eee154c6aa18fe210e7d9f960a15655dce3 (diff) | |
download | ruby-d887a2fc45b9ccd27cb4c029c30f709f748a910c.tar.gz ruby-d887a2fc45b9ccd27cb4c029c30f709f748a910c.tar.xz ruby-d887a2fc45b9ccd27cb4c029c30f709f748a910c.zip |
* parse.y (parser_yylex): should clear parser->tokp as well.
[ruby-dev:32250]
* parse.y: remove NEED_ASSOC that break test_parser_events.
* parse.y (parser_yylex): should not decrement line numbers at the
end of file.
* file.c (rb_find_file_ext): search .rb files first through in the
loadpath.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -4197,16 +4197,16 @@ rb_find_file_ext(VALUE *filep, const char *const *ext) if (!rb_load_path) return 0; Check_Type(rb_load_path, T_ARRAY); - for (i=0;i<RARRAY_LEN(rb_load_path);i++) { - VALUE str = RARRAY_PTR(rb_load_path)[i]; + for (j=0; ext[j]; j++) { + fname = rb_str_dup(*filep); + rb_str_cat2(fname, ext[j]); + OBJ_FREEZE(fname); + for (i=0;i<RARRAY_LEN(rb_load_path);i++) { + VALUE str = RARRAY_PTR(rb_load_path)[i]; - FilePathValue(str); - if (RSTRING_LEN(str) == 0) continue; - path = RSTRING_PTR(str); - for (j=0; ext[j]; j++) { - fname = rb_str_dup(*filep); - rb_str_cat2(fname, ext[j]); - OBJ_FREEZE(fname); + FilePathValue(str); + if (RSTRING_LEN(str) == 0) continue; + path = RSTRING_PTR(str); found = dln_find_file(StringValueCStr(fname), path); if (found && file_load_ok(found)) { *filep = rb_str_new2(found); |