summaryrefslogtreecommitdiffstats
path: root/ruby.c
Commit message (Collapse)AuthorAgeFilesLines
* * dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,nobu2009-03-171-3/+4
| | | | | | | | string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): stop the timer thread before exec.nobu2009-03-151-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * util.c (ruby_scan_oct, ruby_scan_hex): use size_t.nobu2009-03-141-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (ruby_init_loadpath_safe): expands libpath and removesnobu2009-03-101-3/+3
| | | | | | | last /lib. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (MANGLED_PATH): defines for RUBYLIB_PREFIX.nobu2009-03-091-17/+12
| | | | | | | | | * ruby.c (ruby_init_loadpath_safe): uses string as buffer. * symbian/setup (config_h): defines MANGLED_PATH. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (load_relative): new option to enable load pathnobu2009-03-091-0/+9
| | | | | | | | | relative to libruby_so. * ruby.c (ruby_init_loadpath_safe): added the case using dladdr(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/dl.h (dlerror): fixed on Windows.nobu2009-03-021-0/+6
| | | | | | | | * ext/dl/handle.c (rb_dlhandle_initialize): returns handle to libruby if nil is given on Windows as dlopen. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_options): evaluator now expects iseq instead of tree.yugui2009-02-221-3/+3
| | | | | | * ruby.c (ruby_process_options): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h (translit_char): moved from ruby.c.nobu2009-02-191-19/+3
| | | | | | | | | | * load.c (load_ext): transliterates file separators and back if needed. * symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, */Makefile.sub (LOAD_RELATIVE): moved from ruby.cnobu2009-02-191-4/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): set initial default_external before -r.usa2009-02-061-0/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): -K and -E in shebang should be reflect tousa2009-02-061-7/+7
| | | | | | | | default_external. [ruby-dev:37920] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (RUBY_LIB_VERSION): added for library version, tonobu2009-02-051-24/+7
| | | | | | | | | | | | | | | | | | split from core version. [ruby-dev:37748] * configure.in (RUBY_LIB_PATH, etc): moved actual version dependent stuff to version.c. * ruby.c (ruby_init_loadpath_safe): ditto. * version.c (ruby_initial_load_paths): moved initial load path version depending on version from ruby.c. * version.h (RUBY_VERSION_{MAJOR,MINOR,TEENY}): now mean library and API version, and reverted to 1.9.1. [ruby-dev:37889] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): resets EOF flag after parse.nobu2009-02-031-1/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),nobu2009-02-011-2/+2
| | | | | | | | | | | eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c (uscore_get, rb_f_chop), st.c (stat_col), signal.c (rb_signal_buff_size, ruby_sig_finalize), thread.c (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone): protoized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetbyte, rb_io_ungetc): allows nil to reset EOFnobu2009-01-211-0/+1
| | | | | | | | | | flag with ungetting nothing. * ruby.c (load_file_internal): rests EOF flag to make possible to load from stdin after reading data. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): no need to cast.nobu2009-01-211-10/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (require_libraries): reset th->parse_in_eval whileko12009-01-191-0/+4
| | | | | | | | loading libraries. fixes [ruby-dev:37780] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c:ko12009-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn(). rename ruby_iseq_disasm() -> rb_iseq_disasm(). * compile.c: rename ruby_iseq_compile() -> rb_iseq_compile_node(). rename ruby_iseq_translate_threaded_code() -> rb_iseq_translate_threaded_code(). rename ruby_insns_name_array() -> rb_insns_name_array(). rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary(). * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make static function insn_make_insn_table(). * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c, blockinlining.c: ditto. Rename strange "ruby_" prefix to "rb_" prefix. This changes may affect only core because renamed functions require a pointer of rb_iseq_t which is not exposed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): decrement parse_in_eval to recognizeko12009-01-151-2/+2
| | | | | | | | | | | | parsing main or normal eval script. * compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script) * parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * symbian/README.SYMBIAN: symbian support added. great appreciatematz2009-01-151-2/+2
| | | | | | to <alexandre.zavorine at symbian.com>. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): set th->base_block only whileko12008-12-281-11/+27
| | | | | | | | | | it is needed. * ruby.c (require_libraries): clear th->base_block before require libraries. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): fix to untouch th->mild_compile_error.ko12008-12-271-2/+0
| | | | | | | | [ruby-dev:37621], [ruby-dev:37620] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko12008-12-271-2/+22
| | | | | | | | | | | | | | | | | | * vm.c (vm_set_main_stack, rb_iseq_eval_main): added. * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag. * eval.c (ruby_exec_node): use rb_iseq_eval_main() instead of rb_iseq_eval(). * iseq.c (rb_iseq_new_main), vm_core.h: added. main script (specified by -e or script name) should be run under TOPLEVEL_BINDING using Kernel#eval. Above changes simulate Kernel#eval behaviour. [ruby-dev:37240] * compile.c (make_name_for_block): skip iseq except block type. this fix is needed for [ruby-dev:37240], and also fixes [ruby-dev:35392]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): get rid of warning on DOSISH.nobu2008-12-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (set_arg0): use strlcpy() instead of strncpy().usa2008-12-161-2/+1
| | | | | | | | * load.c (rb_feature_p): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): revive global sub, gsub, chop, chompmatz2008-12-151-0/+98
| | | | | | | only when auto looping options (-p/-n) is specified. [ruby-core:20570] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): cannot usenobu2008-12-151-12/+27
| | | | | | | | | | | | | locale encoding before load path is initialized * ruby.c (ruby_init_loadpath_safe): ditto. * ruby.c (process_options): loads encdb so that encodings can be loaded, then associates script name and load paths with the locale encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): fixed default_internal is nil.kouji2008-12-131-1/+1
| | | | | | | (closes #862) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_get_default_encoding): removed.yugui2008-12-121-6/+6
| | | | | | | | | | | | | | | | | | | | Generalizing rb_default_{external,internal}_encoding seems to be difficult. default_external cannot be NULL even before detected. [ruby-dev:37390] * encoding.c (rb_default_external_encoding): has its own implementation again. * encoding.c (rb_default_internal_encoding): ditto. * gem_prelude.rb: added notice. * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): uses locale encoding but not ASCII-8BIT. * ruby.c (process_options): refers less to default_external. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): added version, copyright, usage, yydebug,nobu2008-12-081-43/+58
| | | | | | | syntax to --dump option. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): source-encoding option.nobu2008-12-081-0/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (set_option_encoding_once): dry.nobu2008-12-081-31/+37
| | | | | | | * ruby.c (proc_options): checks extra argument for -E/--encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (usage): -W description updated. [ruby-core:19858]matz2008-11-211-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c (set_internal_encoding_once): fix typo in error stringdavidflanagan2008-11-111-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): delays setting safe level.nobu2008-10-301-13/+20
| | | | | | | [ruby-dev:36997] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): should not set script encoding tomatz2008-10-301-2/+2
| | | | | | | | | ASCII-8BIT. * ruby.c (load_file_internal): do not auto convert scripts even when default_internal is set. [ruby-core:19579] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (moreswitches): splits option string and passes arguments.nobu2008-10-301-83/+108
| | | | | | | | | | | * ruby.c (proc_options): checks if allowed in RUBYOPT. * ruby.c (process_options): allows long style options in RUBYOPT. * ruby.c (load_file_internal): ditto in shebang. [ruby-dev:36979] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): use ASCII-8BIT to prevent conversion.nobu2008-10-291-2/+2
| | | | | | | [ruby-core:19579] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file_internal): cache common interned IDs.nobu2008-10-291-3/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (load_file): preserves $.. [ruby-dev:36937]nobu2008-10-271-3/+32
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (usage): updated the description of -E option.yugui2008-10-251-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_external_str_new): a new function to convert frommatz2008-10-181-9/+5
| | | | | | | | | | | | | | external encoding to internal encoding. if something went wrong, it returns a string with the external encoding. * string.c (rb_external_str_new_with_enc): same as above besides you can specify the source encoding. * ruby.c (ruby_set_argv): use rb_external_str_new() * ruby.c (set_arg0, ruby_script): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): no warning when default_external alreadymatz2008-10-161-1/+2
| | | | | | | | | set by -E. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_rubyopt): put -K after -E to set script encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): -U should be allowed in RUBYOPTmatz2008-10-151-1/+1
| | | | | | environment variable. [ruby-dev:36720] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): -U can be followed by other options.nobu2008-10-141-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (set_internal_encoding_once): check double contradictedmatz2008-10-141-5/+38
| | | | | | | | specification of the encoding from command line. * ruby.c (set_external_encoding_once): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): add -U command line option to specifymatz2008-10-121-0/+4
| | | | | | utf-8 as default_internal. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_default_internal_encoding): merged a patch frommatz2008-10-071-2/+36
| | | | | | | | | | | Michael Selig <michael.selig at fs.com.au> in [ruby-core:18985]. * io.c (rb_io_ext_int_to_encs): ditto. * ruby.c (proc_options): support default internal encoding in -E option. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports VMS.yugui2008-10-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * error.c: ditto. * eval.c: ditto. * eval_intern.h: ditto. * include/ruby/defines.h: ditto. * include/ruby/ruby.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * vms/config.h: removed. * vms/vms.h: ditto. * vms/vmsruby_private.c: ditto. * vms/vmsruby_private.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e