summaryrefslogtreecommitdiff
path: root/load.c
AgeCommit message (Collapse)Author
2012-10-25merge revision(s) ↵usa
34849,34853,34854,34855,34859,34862,35384,35385,36811,36812,36850,36907,36908: [Backport #7174] * Makefile.in (PLATFORM_DIR): add a variable for `win32` directory. * Makefile.in (clean-platform): add new target. It cleans `win32` directory. * common.mk (clean): add a dependency for `win32` directory. * common.mk (distclean): ditto. * common.mk (distclean-platform): add new target. It cleans `win32` directory. * common.mk ($(PLATFORM_D)): add new target to make `win32` directory. * common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32` directory. * common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c. * configure.in: move win32.o into `win32` directory and add win32/file.o to MISSING. * file.c (file_load_ok, rb_file_load_ok): replace static file_load_ok() with public rb_file_load_ok(). It's to link Windows implementation in win32/file.c. * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * win32/file.c (rb_file_load_ok): new file. Add Windows specific optimized implementation of rb_file_load_ok(). We created a separated file to avoid too many #ifdef macro which is unreadable. * win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32` directory. * win32/Makefile.sub (MISSING): move win32.obj into `win32` directory and add win32/file.obj to MISSING. * win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY. It's because miniruby doesn't exist when making `win32` directory. * win32/Makefile.sub (clean-platform): add new target to clean `win32` directory. * win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match win32/file.c to build properly. * win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into `win32` directory. Patch created with Luis Lavena. [ruby-core:42480] [Feature #5999] * win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby. [Bug #6103] [ruby-core:43012] * win32/README.win32: added a notice about command extension of cmd.exe. * win32/makedirs.bat: new command to make intermediate directories, and not to report any errors if the directory already exists. * win32/Makefile.sub (MAKEDIRS): enable command extensions. * win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK. * configure.in (mingw): add shlwapi to the list of dependency libs for Windows. * win32/Makefile.sub (EXTSOLIBS): ditto. * internal.h: declare internal functions rb_w32_init_file, rb_file_expand_path_internal and rb_file_expand_path_fast. * file.c (Init_File): invoke Windows initialization rb_w32_init_file * win32/file.c (rb_file_load_path_internal): new function. Windows-specific implementation that replaces file_expand_path. [Bug #6836][ruby-core:46996] * win32/file.c (rb_w32_init_file): new function. Initialize codepage cache for faster conversion encodings lookup. * file.c (file_expand_path): rename to rb_file_expand_path_internal. Conditionally exclude from Windows. * file.c (rb_file_expand_path_fast): new function. delegates to rb_file_expand_path_internal without performing a hit to the filesystem. * file.c (file_expand_path_1): use rb_file_expand_path_internal without path expansion (used by require). * file.c (rb_find_file_ext_safe): ditto. * file.c (rb_find_file_safe): ditto. * load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast. * load.c (rb_feature_provided): ditto. * file.c (rb_file_expand_path): use rb_file_expand_path_internal with path expansion. * file.c (rb_file_absolute_path): ditto. * test/ruby/test_file_exhaustive.rb: new tests to exercise rb_file_expand_path_internal implementation and compliance with existing behaviors. * test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for posix environments where HOME is not defined. [ruby-core:47322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16merge revision(s) 36800: [Backport #6377]usa
* file.c (rb_find_file_ext_safe, rb_find_file_safe): default to US-ASCII for encdb and transdb. * load.c (search_required): keep encoding of feature name. set loading path to filesystem encoding. [Bug #6377][ruby-core:44750] * ruby.c (add_modules, require_libraries): assume default external encoding as well as ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21merge revision(s) 35625: [Backport #6618]naruse
* thread.c (rb_threadptr_execute_interrupts_common): test_signal_requiring of test/ruby/test_signal.rb fail if the sub process is killed on waiting IO in lex_io_gets in rb_load_file in rb_load_internal in require. This is because (1) the process receive the killing signal in rb_thread_io_blocking_region in rb_read_internal in lex_io_gets. (2) set th->errinfo as INT2FIX(TAG_FATAL) at rb_threadptr_execute_interrupts_common. (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG() without set loaded as TRUE. (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded is FALSE as above. this errinfo should be an exception object but this is INT2FIX(TAG_FATAL). Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@36159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23* backport r33027 from trunk.drbrain
* load.c (rb_f_require): Improve documentation of Kernel#require. [Ruby 1.9 - Bug #5210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10* load.c (rb_f_autoload): prevent to autoload for singletonmrkn
classes. fixes [Bug #4886] [ruby-dev:43816] * bootstraptest/test_autoload.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr
declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 * load.c (loaded_feature_path): cut nonsence loop execution to fixtarui
performance bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. See #4255.nahi
Now __APPLE__ is not CASEFOLD_FILESYSTEM again. * load.c (loaded_feature_path, rb_feature_p, load_lock): Revert r30508. See #4255. Make $LOADED_FEATURES scanning case-sensitive again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-05* load.c (rb_get_expanded_load_path): always expand load paths.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-10* include/ruby/defines.h (CASEFOLD_FILESYSTEM): HFS+ is casenobu
insensitive. * load.c (loaded_feature_path, rb_feature_p, load_lock): on a case-insensitive filesystem, loaded features search should ignore case. [ruby-core:34297] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* load.c (rb_f_require_relative): don't omit return type.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25Document require_relativedrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18* load.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-04* load.c (ruby_init_ext): export for golfers.nobu
* vm_core.h (rb_iseq_eval, rb_iseq_compile_with_option): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29* load.c (rb_provide_feature): clarify error message for frozennobu
$LOADED_FEATURES. based on a patch from Run Paint Run Run at [ruby-core:31913]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29* load.c (load_failed): should honor encoding. [ruby-core:31915]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-18* ruby.c: add prototype of rb_realpath_internal.naruse
* load.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17* load.c (rb_load_internal): remove call to rb_realpath_internalmame
within rb_load_internal which caused big performance degradation. Instead, call rb_realpath_internal in the caller of rb_load_internal. [ruby-dev:41502] [ruby-dev:41610] * vm.c (rb_vm_call_cfunc): ditto. * eval_intern.h (rb_vm_call_cfunc): ditto. * ruby.c (process_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-03* load.c (ruby_init_ext): statically linked extensions have nonobu
real path. [ruby-dev:41526] * vm.c (rb_vm_call_cfunc): add filepath argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-30* load.c (load_failed): use more accurate error message.mame
[ruby-core:23851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* hash.c: Documentation: change => in call-seq to ->.marcandre
* enum.c: Documentation: whitespace fix for r27865 * error.c: ditto * file.c: ditto * io.c: ditto * load.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30* file.c (rb_file_dirname): split from rb_file_s_dirname.nobu
* load.c (rb_f_require_relative): use absolute path instead of expanded path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame
path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13* load.c (rb_get_expanded_load_path): expand paths if any item in $:shugo
is not a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13* load.c (rb_get_expanded_load_path): does not expand paths if allshugo
the items in $: are absolute paths. [ruby-core:28113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24* dln.c (translit_separator): moved back from load.c again.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23* load.c (Kernel#autoload?, Module#autoload?): added doc [ruby-core:19983]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09* load.c (rb_feature_provided): fixed for autoloading extensionnobu
library without suffix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-18* load.c (rb_feature_provided): suppressed warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-23* file.c (rb_find_file_ext, rb_find_file): no needs to expandnobu
paths with tilde twice. * load.c (rb_f_load): load the given path directly if not found in load_path. * load.c (search_required): search file in specified safe level. * load.c (rb_require_safe): path to load is already searched in search_required(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-21* load.c (Init_load): $: must be readonly. [ruby-dev:38690]mame
* ruby.c (ruby_prog_init): $-W must be readonly. [ruby-dev:38691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17* load.c (rb_f_require): RDoc updated. a patch from Run Paint Runmatz
Run in [ruby-core:23833]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13* load.c (load_lock): show backtrace at circular require.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13* load.c (rb_provide): assumes us-ascii only.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13* load.c (rb_require_safe): FilePathValue() implies rb_str_new4().nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13* load.c (rb_mod_autoload): try conversion to path like asnobu
require. [ruby-core:23834] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19* eval_intern.h (translit_char): moved from ruby.c.nobu
* load.c (load_ext): transliterates file separators and back if needed. * symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-03* load.c (load_lock): warn for circular require. [ruby-core:20794],nobu
[ruby-core:20797] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31* load.c (rb_require_safe): raises when the path to be loaded isnobu
tainted. [ruby-dev:37843] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-29* load.c (rb_feature_provided): should not calculate len by pointershugo
subtraction because feature may be a expanded path. [ruby-core:21267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* vm.c: add a prefix "rb_" to exposed functionsko1
vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 * ruby.c (set_arg0): use strlcpy() instead of strncpy().usa
* load.c (rb_feature_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12* load.c (rb_feature_p): load path must be expanded.nobu
[ruby-dev:37388] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04* load.c (rb_get_load_path): returns the load path withoutnobu
touching. * load.c (rb_feature_provided): new function to return the loading path in addition to rb_provided(). * load.c (search_required): sets path if loading. * variable.c (autoload_provided): load paths are expanded to check if loading. * variable.c (autoload_node): keeps autoload mark while loading. [ruby-core:20235] * variable.c (rb_const_get_0): loops while autoload mark is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11* load.c (rb_require_safe): destroys barrier after successfullynobu
loaded, to get rid of loading same library again. [ruby-core:19798] * thread.c (rb_barrier_wait): can not wait destroyed barrier. * thread.c (rb_barrier_destroy): destroys barrier so that no longer waited. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, vm_core.h: move definition ofko1
RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e