of Function to support readline-6.3. (rl_hook_func_t is available
since readline-4.2.)
Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_thread_call_without_gvl2.
(readline_rl_instream, readline_rl_outstream): Record FILE
structures allocated by this extension.
(getc_body): New function extracted from readline_getc.
(getc_func): New function.
(readline_getc): Use rb_thread_call_without_gvl2 to invoke getc_func.
[ruby-dev:47033] [Bug #8749]
(clear_rl_instream, clear_rl_outstream): Close FILE structure
allocated by this extention reliably. [ruby-core:57951] [Bug #9040]
(readline_readline): Use clear_rl_instream and clear_rl_outstream.
(readline_s_set_input): Set readline_rl_instream.
(readline_s_set_output): Set readline_rl_outstream.
(Init_readline): Don't call readline_s_set_input because
readline_getc doesn't block other threads for any FILE structure now.
[ruby-dev:47033] [Bug #8749] reported by Nobuhiro IMAI.
[ruby-core:57951] [Bug #9040] reporeted by Eamonn Webster.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Remove check rl_instream != ifp->stdio_file.
rl_instream is made from duped fd and we cannnot compare.
This fix seems still buggy when rl_instream is manually changed from
other extension libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Readline.readline doesn't work because readline_get doesn't use
rl_getc. The difference is introduced by r42402 [ruby-dev:47509]
[Bug #8644]. Before it rb_io_stdio_file set ifp->stdio_file.
Therefore add manually setting the value.
* ext/readline/readline.c (readline_s_set_onput): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(clear_rl_outstream, readline_s_set_input, clear_rl_instream)
(readline_readline): fix causing SEGV if closed IO object that is
set Readline.input or Readline.output. Patched by akr
[ruby-dev:47509] [Bug #8644]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/readline/readline.c (readline_s_delete_text): call rb_secure
only if level 4 is allowed. otherwise do nothing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unsigned char * before dereference.
This suppress a warning on Cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/readline/readline.c (readline_getc): deal with ESC just followed
by ASCII as meta prefix in incremental search mode. based on the
patch from rctay (Tay Ray Chuan) at [ruby-core:45682]. [Bug #6601]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Readline.special_prefixes): new function. An original patch was
created by nagachika. [Feature #5784]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Readline.insert_text, Readline.redisplay): new function. An
original patch was created by nagachika. [Feature #5785]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78
* dln_find.c: remove useless replacement of free.
* ext/readline/readline.c (readline_attempted_completion_function):
strings for readline must allocated with malloc.
* process.c (run_exec_dup2): use free; see also r20950.
* re.c (onig_new_with_source): use malloc for oniguruma.
* vm.c (ruby_vm_destruct): use free for VMs.
* vm.c (thread_free): use free for threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is closed to get rid of a bug of readline 6. [ruby-dev:45043]
[Bug #5803]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
in Readline module with GNU Readline 6 case, Readline module
resets completion_append_character to " ", after it executes
completion. So, Readline module stores
completion_append_character, and Readline module always sets it
after Readline module executes completion. [ruby-dev:43456]
[Feature #4635]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rl_getc_function only when rl_initialize() is called, and
using_history() call rl_initialize(). This assignment should be
placed before using_history(). [ruby-core:40641] [Bug #5539]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
replace_history_entry may use offset instead of which.
so introduce history_replace_offset_func and initialize it.
* ext/readline/readline.c (hist_set): use history_replace_offset_func.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
#3827 by by Akio Tajima <artonx AT yahoo.co.jp>. (see #3827)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and RL_PROMPT_END_IGNORE. [ruby-core:34331]
* ext/readline/readline.c: enables USE_INSERT_IGNORE_ESCAPE only if
RL_PROMPT_{START,END}_IGNORE are available to get rid of compilation
error with libedit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e