nobu
a67f1a9534
* include/ruby/io.h, io.c: reverted r21709.
...
* ruby.c (load_file_internal): nothing to read if EOF reached
while reading shebang. [ruby-core:30910]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27 14:31:19 +00:00
naruse
72fa4d34c0
* ruby.c: add prototype of rb_realpath_internal.
...
* load.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-18 01:16:13 +00:00
mame
2db572514c
* load.c (rb_load_internal): remove call to rb_realpath_internal
...
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-17 14:32:20 +00:00
nobu
af97da84ed
* ruby.c (process_options, load_file_internal): $0 seen from
...
required libraries by -r option should be the main script.
[ruby-core:23717]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05 06:59:12 +00:00
nobu
2ef85089ec
* ruby.c (process_options): revert r25330, so that $0 can be seen
...
from required libraries by -r option. [ruby-core:23717]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05 00:57:02 +00:00
nobu
87af442f94
* suppress warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 09:10:23 +00:00
nobu
73997d38f4
* ruby.c (ruby_init_loadpath_safe): use real path for non-shared
...
build.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21 04:35:58 +00:00
marcandre
7729de4d91
* array.c: Documentation: change => in call-seq to ->.
...
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-05-17 21:07:33 +00:00
nobu
655b2ade49
* ruby.c (get_arglen): skip the last terminator of argv before
...
checking environ.
* ruby.c (get_arglen): duplicate environ area if setenv and unsetenv
are provided.
* ruby.c (set_arg0): keep empty strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 04:06:59 +00:00
nobu
30014a6156
* ruby.c (PREFIX_PATH): use RUBY_RELATIVE macro.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23 00:14:00 +00:00
nobu
43ab72099b
* configure.in (RUBY_EXEC_PREFIX): added to config.h.
...
* ruby.c (ruby_init_loadpath_safe): TMP_RUBY_PREFIX should be
exec_prefix, not rubylibprefix. [ruby-core:28718]
* version.c (RUBY_LIB_PREFIX): fallback to RUBY_EXEC_PREFIX.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-17 21:28:36 +00:00
mame
6ff75042db
* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute
...
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-16 17:40:00 +00:00
nobu
04e68d0107
* ruby.c (ruby_init_loadpath_safe): mark initial load paths.
...
* gem_prelude.rb (push_all_highest_version_gems_on_load_path):
search insertion position by initial load path mark.
* lib/rubygems.rb (Gem.load_path_insert_index): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-12 15:11:10 +00:00
nobu
1dcf1174ea
* ruby.c (ruby_init_loadpath_safe, ruby_init_gems): set and remove
...
TMP_RUBY_PREFIX.
* variable.c (rb_mod_remove_const): new function.
* tool/compile_prelude.rb: split each preludes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11 22:15:11 +00:00
naruse
77088d6672
* ruby.c (rb_parser_dump_tree): add prototype.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-13 11:29:33 +00:00
mame
38828fa8d1
* node.c: node management added. Currently, only pretty-dumper is
...
implemented. [ruby-dev:39853]
* ruby.c: --dump=parsetree and --dump=parsetree_with_comment options
added. This is just for debug or research purpose. Note that the
compatibility of these options are not supported at all.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-09 14:05:59 +00:00
naruse
a7db2c1efd
* encoding.c (enc_set_default_encoding): reset filesytem
...
encoding because on resetting default_external because
Unix's filesystem encoding depends on default_external.
* encoding.c (enc_set_filesystem_encoding): added.
* ruby.c (process_options): don't call rb_filesystem_encoding
because filesystem encoding is reset when default_external
is reset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18 03:38:20 +00:00
akr
1aba3f9d76
* encoding.c (rb_filesystem_encindex): use default external encoding
...
instead of locale encoding in Unix.
* ruby.c (process_options): delay inifilesystem encoding
initialization after default external encoding initialization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-15 16:37:38 +00:00
nobu
ab4e003969
* ruby.c (set_{internal,external}_encoding_once): fixed typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-04 06:46:32 +00:00
naruse
2f2e8455e3
Revert set locale and filesystem encindex in Init_Encoding.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29 09:40:25 +00:00
naruse
06346d5849
* encoding.c (Init_Encoding): set locale and filesystem encindex.
...
* ruby.c (process_options): move setting func of filesystem
encoding to Init_Encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29 08:14:09 +00:00
naruse
2bb26c118d
* ruby.c (process_options): call rb_filesystem_encoding().
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28 19:42:59 +00:00
mame
1996a4af69
* ruby.c (usage): -T and -W descriptions updated. see
...
[ruby-dev:39539]
* man/ruby.1: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-26 03:41:01 +00:00
nobu
d68e5dce35
* ruby.c (ruby_init_loadpath_safe): should not dup tmp string. a
...
patch from neomjp neomjp in [ruby-core:24251].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-18 09:32:02 +00:00
nobu
0e4121aa5b
* ruby.c (process_options): script name should not be shown in an
...
error message before loaded.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-14 04:24:16 +00:00
nobu
a39f4e5cf6
* ruby.c (process_sflag, proc_options, load_file_internal): fixed
...
types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13 11:18:51 +00:00
nobu
bc832b8e5b
* ruby.c (load_file_internal): no need to define DATA when error.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13 10:38:36 +00:00
nobu
f9be12fb14
* ruby.c (ruby_init_loadpath_safe): suppressed warnings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-27 04:55:55 +00:00
nobu
8bc6c71547
* ruby.c (load_file_internal): assumes -x flag if no "ruby" is in
...
the shebang line. [ruby-dev:39015]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 10:19:18 +00:00
nobu
cb9038cbaf
* io.c (rb_stdio_set_default_encoding): prototyped.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 10:18:21 +00:00
naruse
c6abdf3e0c
* ruby.c (rb_stdio_set_default_encoding): declared.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05 10:12:31 +00:00
naruse
00499c097f
Set encodings of stdio after setting default internal and external.
...
* io.c (rb_stdio_set_default_encoding): added.
* ruby.c (process_options): call rb_stdio_set_default_encoding
after setting defualt internal and external.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-31 07:37:02 +00:00
akr
98aac1e651
* ruby.c (process_options): don't specify .so for encdb here.
...
"." is replaced by "_" in load_encoding.
* encoding.c (load_encoding): add .so here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 16:21:09 +00:00
nobu
4a81d13592
* ruby.c (ruby_init_loadpath_safe): removed "." from load_path.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 07:26:16 +00:00
nobu
c030cf1975
* ruby.c (process_options), enc/prelude.rb: encdb and transdb are
...
extension libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 05:41:51 +00:00
nobu
210e51f3bd
* ruby.c (process_options): set progname earlier.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 05:35:51 +00:00
mame
5d30ddec17
* load.c (Init_load): $: must be readonly. [ruby-dev:38690]
...
* 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-21 13:35:41 +00:00
nobu
3b6d6b0861
* ruby.c (ruby_init_loadpath_safe): VARIABLE_LIBPATH is always
...
defined, see its value instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 14:05:08 +00:00
nobu
589ec2beb5
* ruby.c (ruby_script): sets also VM toplevel program name.
...
* ruby.c (process_options): no longer needs additional frame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 05:02:58 +00:00
nobu
cda453c238
* ruby.c (cmdline_options_init): initialize encodings.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 00:51:09 +00:00
nobu
64f767b556
* ruby.c (cmdline_options_init): initialize encodings.
...
* ruby.c (add_modules, require_libraries, process_sflag):
* ruby.c (process_sflag): not process twice.
* ruby.c (moreswitches): get rid of possible overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 00:47:49 +00:00
nobu
bd9a5871dd
* ruby.c (ruby_init_loadpath_safe): support for cygwin 1.7. see
...
[ruby-core:23241].
gets rid of possible buffer overflow with realpath().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 00:02:58 +00:00
nobu
214e725334
* ruby.c (set_arg0): get rids of overrun.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 23:55:46 +00:00
nobu
22cde7b682
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
...
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 01:29:17 +00:00
nobu
731504b4d3
* ruby.c (load_file_internal): stop the timer thread before exec.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-15 02:00:15 +00:00
nobu
4de12b6ae9
* util.c (ruby_scan_oct, ruby_scan_hex): use size_t.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14 09:25:20 +00:00
nobu
745bc1fd83
* ruby.c (ruby_init_loadpath_safe): expands libpath and removes
...
last /lib.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10 21:12:49 +00:00
nobu
ee4fbaa37e
* configure.in (MANGLED_PATH): defines for RUBYLIB_PREFIX.
...
* ruby.c (ruby_init_loadpath_safe): uses string as buffer.
* symbian/setup (config_h): defines MANGLED_PATH.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09 19:56:46 +00:00
nobu
31d1d0a829
* configure.in (load_relative): new option to enable load path
...
relative to libruby_so.
* ruby.c (ruby_init_loadpath_safe): added the case using dladdr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09 15:06:22 +00:00
nobu
033bed37c8
* ext/dl/dl.h (dlerror): fixed on Windows.
...
* ext/dl/handle.c (rb_dlhandle_initialize): returns handle to
libruby if nil is given on Windows as dlopen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02 02:01:48 +00:00