2008-08-07 11:06:36 -04:00
|
|
|
/************************************************
|
|
|
|
|
|
|
|
readline.c - GNU Readline module
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
created at: Wed Jan 20 13:59:32 JST 1999
|
|
|
|
|
|
|
|
Copyright (C) 1997-2008 Shugo Maeda
|
2013-08-06 09:07:25 -04:00
|
|
|
Copyright (C) 2008-2013 Kouji Takao
|
2008-08-07 11:06:36 -04:00
|
|
|
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
Contact:
|
2013-08-06 09:07:25 -04:00
|
|
|
- Kouji Takao <kouji dot takao at gmail dot com> (current maintainer)
|
2008-08-07 11:06:36 -04:00
|
|
|
|
|
|
|
************************************************/
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2006-06-09 19:18:04 -04:00
|
|
|
#ifdef RUBY_EXTCONF_H
|
|
|
|
#include RUBY_EXTCONF_H
|
|
|
|
#endif
|
|
|
|
|
2007-06-09 23:06:15 -04:00
|
|
|
#include "ruby/config.h"
|
2002-06-20 08:14:33 -04:00
|
|
|
#include <errno.h>
|
1999-01-19 23:59:32 -05:00
|
|
|
#include <stdio.h>
|
2005-05-20 02:57:06 -04:00
|
|
|
#include <string.h>
|
2005-05-19 10:36:20 -04:00
|
|
|
#ifdef HAVE_READLINE_READLINE_H
|
1999-01-19 23:59:32 -05:00
|
|
|
#include <readline/readline.h>
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_READLINE_HISTORY_H
|
1999-01-19 23:59:32 -05:00
|
|
|
#include <readline/history.h>
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_EDITLINE_READLINE_H
|
|
|
|
#include <editline/readline.h>
|
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2007-06-09 23:06:15 -04:00
|
|
|
#include "ruby/io.h"
|
2013-10-27 08:04:14 -04:00
|
|
|
#include "ruby/thread.h"
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2003-07-26 11:03:16 -04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2011-12-23 20:56:36 -05:00
|
|
|
#ifdef HAVE_SYS_STAT_H
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE mReadline;
|
|
|
|
|
2008-08-01 11:04:37 -04:00
|
|
|
#define EDIT_LINE_LIBRARY_VERSION "EditLine wrapper"
|
2011-01-09 00:54:33 -05:00
|
|
|
#ifndef USE_INSERT_IGNORE_ESCAPE
|
2013-02-01 00:37:29 -05:00
|
|
|
# if !defined(HAVE_EDITLINE_READLINE_H) && defined(RL_PROMPT_START_IGNORE) && defined(RL_PROMPT_END_IGNORE)
|
2011-01-09 00:54:33 -05:00
|
|
|
# define USE_INSERT_IGNORE_ESCAPE 1
|
|
|
|
# else
|
|
|
|
# define USE_INSERT_IGNORE_ESCAPE 0
|
|
|
|
# endif
|
|
|
|
#endif
|
2008-08-01 11:04:37 -04:00
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
#define COMPLETION_PROC "completion_proc"
|
|
|
|
#define COMPLETION_CASE_FOLD "completion_case_fold"
|
2016-10-03 03:10:49 -04:00
|
|
|
static ID id_call, completion_proc, completion_case_fold;
|
2016-10-03 04:20:07 -04:00
|
|
|
#if defined HAVE_RL_CHAR_IS_QUOTED_P
|
|
|
|
#define QUOTING_DETECTION_PROC "quoting_detection_proc"
|
|
|
|
static ID quoting_detection_proc;
|
|
|
|
#endif
|
2011-01-09 00:54:33 -05:00
|
|
|
#if USE_INSERT_IGNORE_ESCAPE
|
|
|
|
static ID id_orig_prompt, id_last_prompt;
|
|
|
|
#endif
|
2012-05-01 09:21:55 -04:00
|
|
|
#if defined(HAVE_RL_PRE_INPUT_HOOK)
|
|
|
|
static ID id_pre_input_hook;
|
|
|
|
#endif
|
2012-05-01 20:47:57 -04:00
|
|
|
#if defined(HAVE_RL_SPECIAL_PREFIXES)
|
|
|
|
static ID id_special_prefixes;
|
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2005-05-19 10:36:20 -04:00
|
|
|
#ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION
|
2001-05-06 11:06:00 -04:00
|
|
|
# define rl_filename_completion_function filename_completion_function
|
2006-12-14 04:41:37 -05:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_RL_USERNAME_COMPLETION_FUNCTION
|
2001-05-06 11:06:00 -04:00
|
|
|
# define rl_username_completion_function username_completion_function
|
2018-10-07 05:17:59 -04:00
|
|
|
#else
|
|
|
|
char *rl_username_completion_function(const char *, int);
|
2006-12-14 04:41:37 -05:00
|
|
|
#endif
|
|
|
|
#ifndef HAVE_RL_COMPLETION_MATCHES
|
2001-05-07 05:26:29 -04:00
|
|
|
# define rl_completion_matches completion_matches
|
2001-05-06 11:06:00 -04:00
|
|
|
#endif
|
|
|
|
|
2008-08-01 11:04:37 -04:00
|
|
|
static int (*history_get_offset_func)(int);
|
2011-11-03 12:23:58 -04:00
|
|
|
static int (*history_replace_offset_func)(int);
|
2011-12-23 02:38:14 -05:00
|
|
|
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
|
|
|
static int readline_completion_append_character;
|
|
|
|
#endif
|
2008-08-01 11:04:37 -04:00
|
|
|
|
2005-05-19 10:36:20 -04:00
|
|
|
static char **readline_attempted_completion_function(const char *text,
|
|
|
|
int start, int end);
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
#define OutputStringValue(str) do {\
|
2017-09-30 04:35:23 -04:00
|
|
|
StringValueCStr(str);\
|
2011-03-23 08:09:57 -04:00
|
|
|
(str) = rb_str_conv_enc((str), rb_enc_get(str), rb_locale_encoding());\
|
2008-12-12 07:44:08 -05:00
|
|
|
} while (0)\
|
|
|
|
|
2008-02-19 00:27:35 -05:00
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* Document-class: Readline
|
|
|
|
*
|
|
|
|
* The Readline module provides interface for GNU Readline.
|
|
|
|
* This module defines a number of methods to facilitate completion
|
|
|
|
* and accesses input history from the Ruby interpreter.
|
|
|
|
* This module supported Edit Line(libedit) too.
|
|
|
|
* libedit is compatible with GNU Readline.
|
|
|
|
*
|
|
|
|
* GNU Readline:: http://www.gnu.org/directory/readline.html
|
|
|
|
* libedit:: http://www.thrysoee.dk/editline/
|
|
|
|
*
|
2010-04-22 04:04:13 -04:00
|
|
|
* Reads one inputted line with line edit by Readline.readline method.
|
2008-08-07 11:06:36 -04:00
|
|
|
* At this time, the facilitatation completion and the key
|
|
|
|
* bind like Emacs can be operated like GNU Readline.
|
|
|
|
*
|
|
|
|
* require "readline"
|
|
|
|
* while buf = Readline.readline("> ", true)
|
|
|
|
* p buf
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* The content that the user input can be recorded to the history.
|
|
|
|
* The history can be accessed by Readline::HISTORY constant.
|
|
|
|
*
|
|
|
|
* require "readline"
|
|
|
|
* while buf = Readline.readline("> ", true)
|
|
|
|
* p Readline::HISTORY.to_a
|
|
|
|
* print("-> ", buf, "\n")
|
|
|
|
* end
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Documented by Kouji Takao <kouji dot takao at gmail dot com>.
|
2008-08-07 11:06:36 -04:00
|
|
|
*/
|
|
|
|
|
2009-04-26 12:25:15 -04:00
|
|
|
static VALUE readline_instream;
|
2013-08-06 08:24:40 -04:00
|
|
|
static VALUE readline_outstream;
|
2013-10-27 08:04:14 -04:00
|
|
|
static FILE *readline_rl_instream;
|
|
|
|
static FILE *readline_rl_outstream;
|
2013-08-06 08:24:40 -04:00
|
|
|
|
2016-10-03 03:10:49 -04:00
|
|
|
static void
|
|
|
|
mustbe_callable(VALUE proc)
|
|
|
|
{
|
|
|
|
if (!NIL_P(proc) && !rb_respond_to(proc, id_call))
|
|
|
|
rb_raise(rb_eArgError, "argument must respond to `call'");
|
|
|
|
}
|
|
|
|
|
2013-08-06 08:24:40 -04:00
|
|
|
#if defined HAVE_RL_GETC_FUNCTION
|
2009-04-26 12:25:15 -04:00
|
|
|
|
2010-08-16 18:50:40 -04:00
|
|
|
#ifndef HAVE_RL_GETC
|
|
|
|
#define rl_getc(f) EOF
|
2010-07-13 08:34:19 -04:00
|
|
|
#endif
|
|
|
|
|
2013-10-27 08:04:14 -04:00
|
|
|
struct getc_struct {
|
|
|
|
FILE *input;
|
|
|
|
int fd;
|
|
|
|
int ret;
|
|
|
|
int err;
|
|
|
|
};
|
|
|
|
|
2009-04-26 12:25:15 -04:00
|
|
|
static int
|
2013-10-27 08:04:14 -04:00
|
|
|
getc_body(struct getc_struct *p)
|
2009-04-26 12:25:15 -04:00
|
|
|
{
|
2013-10-27 08:04:14 -04:00
|
|
|
char ch;
|
|
|
|
ssize_t ss;
|
|
|
|
|
2011-06-21 00:30:14 -04:00
|
|
|
#if defined(_WIN32)
|
|
|
|
{
|
|
|
|
INPUT_RECORD ir;
|
2017-03-04 00:13:18 -05:00
|
|
|
DWORD n;
|
2011-06-21 00:30:14 -04:00
|
|
|
static int prior_key = '0';
|
|
|
|
for (;;) {
|
2017-03-04 00:13:18 -05:00
|
|
|
HANDLE h;
|
2011-06-21 00:30:14 -04:00
|
|
|
if (prior_key > 0xff) {
|
2013-10-27 08:04:14 -04:00
|
|
|
prior_key = rl_getc(p->input);
|
2011-06-21 00:30:14 -04:00
|
|
|
return prior_key;
|
|
|
|
}
|
2017-03-04 00:13:18 -05:00
|
|
|
h = (HANDLE)_get_osfhandle(p->fd);
|
|
|
|
if (PeekConsoleInput(h, &ir, 1, &n)) {
|
2011-06-21 00:30:14 -04:00
|
|
|
if (n == 1) {
|
|
|
|
if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) {
|
2013-10-27 08:04:14 -04:00
|
|
|
prior_key = rl_getc(p->input);
|
2011-06-21 00:30:14 -04:00
|
|
|
return prior_key;
|
|
|
|
} else {
|
2017-03-04 00:13:18 -05:00
|
|
|
ReadConsoleInput(h, &ir, 1, &n);
|
2011-06-21 00:30:14 -04:00
|
|
|
}
|
|
|
|
} else {
|
2017-03-06 03:10:20 -05:00
|
|
|
rb_w32_wait_events_blocking(&h, 1, INFINITE);
|
2011-06-21 00:30:14 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-11-04 03:19:23 -04:00
|
|
|
#endif
|
2013-10-27 08:04:14 -04:00
|
|
|
|
|
|
|
ss = read(p->fd, &ch, 1);
|
|
|
|
if (ss == 0) {
|
|
|
|
errno = 0;
|
|
|
|
return EOF;
|
2012-06-17 21:43:00 -04:00
|
|
|
}
|
2013-10-27 08:04:14 -04:00
|
|
|
if (ss != 1)
|
|
|
|
return EOF;
|
|
|
|
return (unsigned char)ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
|
|
|
getc_func(void *data1)
|
|
|
|
{
|
|
|
|
struct getc_struct *p = data1;
|
|
|
|
errno = 0;
|
|
|
|
p->ret = getc_body(p);
|
|
|
|
p->err = errno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
readline_getc(FILE *input)
|
|
|
|
{
|
|
|
|
struct getc_struct data;
|
2013-10-28 23:09:00 -04:00
|
|
|
if (input == NULL) /* editline may give NULL as input. */
|
|
|
|
input = stdin;
|
2013-10-27 08:04:14 -04:00
|
|
|
data.input = input;
|
|
|
|
data.fd = fileno(input);
|
|
|
|
again:
|
|
|
|
data.ret = EOF;
|
|
|
|
data.err = EINTR; /* getc_func is not called if already interrupted. */
|
|
|
|
rb_thread_call_without_gvl2(getc_func, &data, RUBY_UBF_IO, NULL);
|
|
|
|
if (data.ret == EOF) {
|
|
|
|
if (data.err == 0) {
|
|
|
|
return EOF;
|
|
|
|
}
|
|
|
|
if (data.err == EINTR) {
|
|
|
|
rb_thread_check_ints();
|
|
|
|
goto again;
|
|
|
|
}
|
|
|
|
if (data.err == EWOULDBLOCK || data.err == EAGAIN) {
|
|
|
|
int ret;
|
|
|
|
if (fileno(input) != data.fd)
|
|
|
|
rb_bug("readline_getc: input closed unexpectedly or memory corrupted");
|
|
|
|
ret = rb_wait_for_single_fd(data.fd, RB_WAITFD_IN, NULL);
|
|
|
|
if (ret != -1 || errno == EINTR)
|
|
|
|
goto again;
|
|
|
|
rb_sys_fail("rb_wait_for_single_fd");
|
|
|
|
}
|
2015-07-08 01:05:12 -04:00
|
|
|
rb_syserr_fail(data.err, "read");
|
2013-10-27 08:04:14 -04:00
|
|
|
}
|
|
|
|
return data.ret;
|
2009-04-26 12:25:15 -04:00
|
|
|
}
|
2013-10-27 08:04:14 -04:00
|
|
|
|
2009-04-26 12:25:15 -04:00
|
|
|
#elif defined HAVE_RL_EVENT_HOOK
|
|
|
|
#define BUSY_WAIT 0
|
|
|
|
|
2008-02-19 00:27:35 -05:00
|
|
|
static int readline_event(void);
|
1999-01-19 23:59:32 -05:00
|
|
|
static int
|
2008-02-19 00:27:35 -05:00
|
|
|
readline_event(void)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-02-19 00:27:35 -05:00
|
|
|
#if BUSY_WAIT
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_thread_schedule();
|
2008-02-19 00:27:35 -05:00
|
|
|
#else
|
2011-05-03 21:13:02 -04:00
|
|
|
rb_wait_for_single_fd(fileno(rl_instream), RB_WAITFD_IN, NULL);
|
2001-06-23 05:30:42 -04:00
|
|
|
return 0;
|
2008-02-19 00:27:35 -05:00
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2008-02-19 00:27:35 -05:00
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2011-01-09 00:54:33 -05:00
|
|
|
#if USE_INSERT_IGNORE_ESCAPE
|
|
|
|
static VALUE
|
|
|
|
insert_ignore_escape(VALUE self, VALUE prompt)
|
|
|
|
{
|
|
|
|
VALUE last_prompt, orig_prompt = rb_attr_get(self, id_orig_prompt);
|
|
|
|
int ignoring = 0;
|
|
|
|
const char *s0, *s, *e;
|
|
|
|
long len;
|
|
|
|
static const char ignore_code[2] = {RL_PROMPT_START_IGNORE, RL_PROMPT_END_IGNORE};
|
|
|
|
|
|
|
|
prompt = rb_str_new_shared(prompt);
|
|
|
|
last_prompt = rb_attr_get(self, id_last_prompt);
|
|
|
|
if (orig_prompt == prompt) return last_prompt;
|
|
|
|
len = RSTRING_LEN(prompt);
|
|
|
|
if (NIL_P(last_prompt)) {
|
2013-08-06 09:07:25 -04:00
|
|
|
last_prompt = rb_str_tmp_new(len);
|
2011-01-09 00:54:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
s = s0 = RSTRING_PTR(prompt);
|
|
|
|
e = s0 + len;
|
|
|
|
rb_str_set_len(last_prompt, 0);
|
|
|
|
while (s < e && *s) {
|
2013-08-06 09:07:25 -04:00
|
|
|
switch (*s) {
|
|
|
|
case RL_PROMPT_START_IGNORE:
|
|
|
|
ignoring = -1;
|
|
|
|
rb_str_cat(last_prompt, s0, ++s - s0);
|
|
|
|
s0 = s;
|
|
|
|
break;
|
|
|
|
case RL_PROMPT_END_IGNORE:
|
|
|
|
ignoring = 0;
|
|
|
|
rb_str_cat(last_prompt, s0, ++s - s0);
|
|
|
|
s0 = s;
|
|
|
|
break;
|
|
|
|
case '\033':
|
|
|
|
if (++s < e && *s == '[') {
|
|
|
|
rb_str_cat(last_prompt, s0, s - s0 - 1);
|
|
|
|
s0 = s - 1;
|
|
|
|
while (++s < e && *s) {
|
|
|
|
if (ISALPHA(*(unsigned char *)s)) {
|
|
|
|
if (!ignoring) {
|
|
|
|
ignoring = 1;
|
|
|
|
rb_str_cat(last_prompt, ignore_code+0, 1);
|
|
|
|
}
|
|
|
|
rb_str_cat(last_prompt, s0, ++s - s0);
|
|
|
|
s0 = s;
|
|
|
|
break;
|
|
|
|
}
|
2013-08-09 11:27:41 -04:00
|
|
|
else if (!(('0' <= *s && *s <= '9') || *s == ';')) {
|
2013-08-06 09:07:25 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (ignoring > 0) {
|
|
|
|
ignoring = 0;
|
|
|
|
rb_str_cat(last_prompt, ignore_code+1, 1);
|
|
|
|
}
|
|
|
|
s++;
|
|
|
|
break;
|
|
|
|
}
|
2011-01-09 00:54:33 -05:00
|
|
|
}
|
|
|
|
if (ignoring > 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
ignoring = 0;
|
|
|
|
rb_str_cat(last_prompt, ignore_code+1, 1);
|
2011-01-09 00:54:33 -05:00
|
|
|
}
|
|
|
|
rb_str_cat(last_prompt, s0, s - s0);
|
|
|
|
|
|
|
|
rb_ivar_set(self, id_orig_prompt, prompt);
|
|
|
|
rb_ivar_set(self, id_last_prompt, last_prompt);
|
|
|
|
|
|
|
|
return last_prompt;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-04-26 12:25:15 -04:00
|
|
|
static VALUE
|
|
|
|
readline_get(VALUE prompt)
|
|
|
|
{
|
2011-12-23 02:38:14 -05:00
|
|
|
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
|
|
|
readline_completion_append_character = rl_completion_append_character;
|
|
|
|
#endif
|
2009-04-26 12:25:15 -04:00
|
|
|
return (VALUE)readline((char *)prompt);
|
|
|
|
}
|
|
|
|
|
2013-10-27 08:04:14 -04:00
|
|
|
static void
|
|
|
|
clear_rl_instream(void)
|
|
|
|
{
|
|
|
|
if (readline_rl_instream) {
|
|
|
|
fclose(readline_rl_instream);
|
|
|
|
if (rl_instream == readline_rl_instream)
|
|
|
|
rl_instream = NULL;
|
|
|
|
readline_rl_instream = NULL;
|
|
|
|
}
|
|
|
|
readline_instream = Qfalse;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clear_rl_outstream(void)
|
|
|
|
{
|
|
|
|
if (readline_rl_outstream) {
|
|
|
|
fclose(readline_rl_outstream);
|
|
|
|
if (rl_outstream == readline_rl_outstream)
|
|
|
|
rl_outstream = NULL;
|
|
|
|
readline_rl_outstream = NULL;
|
|
|
|
}
|
|
|
|
readline_outstream = Qfalse;
|
|
|
|
}
|
|
|
|
|
2015-01-14 01:43:50 -05:00
|
|
|
static void
|
|
|
|
prepare_readline(void)
|
|
|
|
{
|
|
|
|
static int initialized = 0;
|
|
|
|
if (!initialized) {
|
|
|
|
rl_initialize();
|
|
|
|
initialized = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (readline_instream) {
|
|
|
|
rb_io_t *ifp;
|
|
|
|
rb_io_check_initialized(ifp = RFILE(rb_io_taint_check(readline_instream))->fptr);
|
|
|
|
if (ifp->fd < 0) {
|
|
|
|
clear_rl_instream();
|
|
|
|
rb_raise(rb_eIOError, "closed readline input");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (readline_outstream) {
|
|
|
|
rb_io_t *ofp;
|
|
|
|
rb_io_check_initialized(ofp = RFILE(rb_io_taint_check(readline_outstream))->fptr);
|
|
|
|
if (ofp->fd < 0) {
|
|
|
|
clear_rl_outstream();
|
|
|
|
rb_raise(rb_eIOError, "closed readline output");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.readline(prompt = "", add_hist = false) -> string or nil
|
|
|
|
*
|
|
|
|
* Shows the +prompt+ and reads the inputted line with line editing.
|
|
|
|
* The inputted line is added to the history if +add_hist+ is true.
|
|
|
|
*
|
|
|
|
* Returns nil when the inputted line is empty and user inputs EOF
|
|
|
|
* (Presses ^D on UNIX).
|
|
|
|
*
|
2013-08-06 08:24:40 -04:00
|
|
|
* Raises IOError exception if one of below conditions are satisfied.
|
|
|
|
* 1. stdin was closed.
|
|
|
|
* 2. stdout was closed.
|
2008-08-07 11:06:36 -04:00
|
|
|
*
|
2013-05-18 23:10:21 -04:00
|
|
|
* This method supports thread. Switches the thread context when waits
|
2008-08-07 11:06:36 -04:00
|
|
|
* inputting line.
|
|
|
|
*
|
|
|
|
* Supports line edit when inputs line. Provides VI and Emacs editing mode.
|
|
|
|
* Default is Emacs editing mode.
|
|
|
|
*
|
|
|
|
* NOTE: Terminates ruby interpreter and does not return the terminal
|
|
|
|
* status after user pressed '^C' when wait inputting line.
|
|
|
|
* Give 3 examples that avoid it.
|
|
|
|
*
|
|
|
|
* * Catches the Interrupt exception by pressed ^C after returns
|
|
|
|
* terminal status:
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* stty_save = `stty -g`.chomp
|
|
|
|
* begin
|
|
|
|
* while buf = Readline.readline
|
|
|
|
* p buf
|
|
|
|
* end
|
|
|
|
* rescue Interrupt
|
|
|
|
* system("stty", stty_save)
|
|
|
|
* exit
|
|
|
|
* end
|
|
|
|
* end
|
|
|
|
* end
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* * Catches the INT signal by pressed ^C after returns terminal
|
|
|
|
* status:
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* stty_save = `stty -g`.chomp
|
|
|
|
* trap("INT") { system "stty", stty_save; exit }
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* while buf = Readline.readline
|
|
|
|
* p buf
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* * Ignores pressing ^C:
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* trap("INT", "SIG_IGN")
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* while buf = Readline.readline
|
|
|
|
* p buf
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* Can make as follows with Readline::HISTORY constant.
|
|
|
|
* It does not record to the history if the inputted line is empty or
|
|
|
|
* the same it as last one.
|
|
|
|
*
|
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* while buf = Readline.readline("> ", true)
|
|
|
|
* # p Readline::HISTORY.to_a
|
|
|
|
* Readline::HISTORY.pop if /^\s*$/ =~ buf
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* begin
|
|
|
|
* if Readline::HISTORY[Readline::HISTORY.length-2] == buf
|
2010-04-22 04:04:13 -04:00
|
|
|
* Readline::HISTORY.pop
|
2008-08-07 11:06:36 -04:00
|
|
|
* end
|
|
|
|
* rescue IndexError
|
|
|
|
* end
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* # p Readline::HISTORY.to_a
|
|
|
|
* print "-> ", buf, "\n"
|
|
|
|
* end
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_readline(int argc, VALUE *argv, VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
VALUE tmp, add_hist, result;
|
|
|
|
char *prompt = NULL;
|
|
|
|
char *buff;
|
2001-09-06 01:14:06 -04:00
|
|
|
int status;
|
1999-01-19 23:59:32 -05:00
|
|
|
|
|
|
|
if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
OutputStringValue(tmp);
|
2011-01-09 00:54:33 -05:00
|
|
|
#if USE_INSERT_IGNORE_ESCAPE
|
2013-08-06 09:07:25 -04:00
|
|
|
tmp = insert_ignore_escape(self, tmp);
|
|
|
|
rb_str_locktmp(tmp);
|
2011-01-09 00:54:33 -05:00
|
|
|
#endif
|
2013-08-06 09:07:25 -04:00
|
|
|
prompt = RSTRING_PTR(tmp);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2001-09-06 01:14:06 -04:00
|
|
|
|
2015-01-14 01:43:50 -05:00
|
|
|
prepare_readline();
|
2002-06-20 08:14:33 -04:00
|
|
|
|
2009-08-21 02:04:21 -04:00
|
|
|
#ifdef _WIN32
|
|
|
|
rl_prep_terminal(1);
|
|
|
|
#endif
|
2009-04-26 12:25:15 -04:00
|
|
|
buff = (char*)rb_protect(readline_get, (VALUE)prompt, &status);
|
2011-01-09 00:54:33 -05:00
|
|
|
#if USE_INSERT_IGNORE_ESCAPE
|
|
|
|
if (prompt) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rb_str_unlocktmp(tmp);
|
2011-01-09 00:54:33 -05:00
|
|
|
}
|
|
|
|
#endif
|
2001-09-06 01:14:06 -04:00
|
|
|
if (status) {
|
2005-05-19 10:36:20 -04:00
|
|
|
#if defined HAVE_RL_CLEANUP_AFTER_SIGNAL
|
2001-09-06 01:14:06 -04:00
|
|
|
/* restore terminal mode and signal handler*/
|
2010-08-16 18:50:40 -04:00
|
|
|
#if defined HAVE_RL_FREE_LINE_STATE
|
2009-07-15 23:45:12 -04:00
|
|
|
rl_free_line_state();
|
2010-08-16 18:50:40 -04:00
|
|
|
#endif
|
2001-09-06 01:14:06 -04:00
|
|
|
rl_cleanup_after_signal();
|
2005-05-19 10:36:20 -04:00
|
|
|
#elif defined HAVE_RL_DEPREP_TERM_FUNCTION
|
2001-09-06 01:14:06 -04:00
|
|
|
/* restore terminal mode */
|
2013-08-06 09:07:25 -04:00
|
|
|
if (rl_deprep_term_function != NULL) /* NULL in libedit. [ruby-dev:29116] */
|
|
|
|
(*rl_deprep_term_function)();
|
|
|
|
else
|
2001-09-06 01:14:06 -04:00
|
|
|
#else
|
|
|
|
rl_deprep_terminal();
|
|
|
|
#endif
|
|
|
|
rb_jump_tag(status);
|
|
|
|
}
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
if (RTEST(add_hist) && buff) {
|
2013-08-06 09:07:25 -04:00
|
|
|
add_history(buff);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2007-12-28 04:46:44 -05:00
|
|
|
if (buff) {
|
2013-08-06 09:07:25 -04:00
|
|
|
result = rb_locale_str_new_cstr(buff);
|
2007-12-28 04:46:44 -05:00
|
|
|
}
|
1999-01-19 23:59:32 -05:00
|
|
|
else
|
2013-08-06 09:07:25 -04:00
|
|
|
result = Qnil;
|
1999-01-19 23:59:32 -05:00
|
|
|
if (buff) free(buff);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.input = input
|
|
|
|
*
|
|
|
|
* Specifies a File object +input+ that is input stream for
|
|
|
|
* Readline.readline method.
|
|
|
|
*/
|
2005-06-17 12:18:56 -04:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_input(VALUE self, VALUE input)
|
2005-06-17 12:18:56 -04:00
|
|
|
{
|
* file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
renamed from OpenFile.
* ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
ext/readline/readline.c, ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:30:50 -05:00
|
|
|
rb_io_t *ifp;
|
2013-08-06 08:24:40 -04:00
|
|
|
int fd;
|
|
|
|
FILE *f;
|
2005-06-17 12:18:56 -04:00
|
|
|
|
2013-08-06 08:24:40 -04:00
|
|
|
if (NIL_P(input)) {
|
|
|
|
clear_rl_instream();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Check_Type(input, T_FILE);
|
|
|
|
GetOpenFile(input, ifp);
|
|
|
|
clear_rl_instream();
|
|
|
|
fd = rb_cloexec_dup(ifp->fd);
|
|
|
|
if (fd == -1)
|
|
|
|
rb_sys_fail("dup");
|
|
|
|
f = fdopen(fd, "r");
|
|
|
|
if (f == NULL) {
|
|
|
|
int save_errno = errno;
|
|
|
|
close(fd);
|
2015-07-08 01:05:12 -04:00
|
|
|
rb_syserr_fail(save_errno, "fdopen");
|
2013-08-06 08:24:40 -04:00
|
|
|
}
|
2013-10-27 08:04:14 -04:00
|
|
|
rl_instream = readline_rl_instream = f;
|
2013-08-06 08:24:40 -04:00
|
|
|
readline_instream = input;
|
|
|
|
}
|
2005-06-17 12:18:56 -04:00
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.output = output
|
|
|
|
*
|
|
|
|
* Specifies a File object +output+ that is output stream for
|
|
|
|
* Readline.readline method.
|
|
|
|
*/
|
2005-06-17 12:18:56 -04:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_output(VALUE self, VALUE output)
|
2005-06-17 12:18:56 -04:00
|
|
|
{
|
* file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
renamed from OpenFile.
* ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
ext/readline/readline.c, ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:30:50 -05:00
|
|
|
rb_io_t *ofp;
|
2013-08-06 08:24:40 -04:00
|
|
|
int fd;
|
|
|
|
FILE *f;
|
2005-06-17 12:18:56 -04:00
|
|
|
|
2013-08-06 08:24:40 -04:00
|
|
|
if (NIL_P(output)) {
|
|
|
|
clear_rl_outstream();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Check_Type(output, T_FILE);
|
|
|
|
GetOpenFile(output, ofp);
|
|
|
|
clear_rl_outstream();
|
|
|
|
fd = rb_cloexec_dup(ofp->fd);
|
|
|
|
if (fd == -1)
|
|
|
|
rb_sys_fail("dup");
|
|
|
|
f = fdopen(fd, "w");
|
|
|
|
if (f == NULL) {
|
|
|
|
int save_errno = errno;
|
|
|
|
close(fd);
|
2015-07-08 01:05:12 -04:00
|
|
|
rb_syserr_fail(save_errno, "fdopen");
|
2013-08-06 08:24:40 -04:00
|
|
|
}
|
2013-10-27 08:04:14 -04:00
|
|
|
rl_outstream = readline_rl_outstream = f;
|
2013-08-06 08:24:40 -04:00
|
|
|
readline_outstream = output;
|
|
|
|
}
|
2005-06-17 12:18:56 -04:00
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2012-05-01 09:21:55 -04:00
|
|
|
#if defined(HAVE_RL_PRE_INPUT_HOOK)
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.pre_input_hook = proc
|
|
|
|
*
|
|
|
|
* Specifies a Proc object +proc+ to call after the first prompt has
|
|
|
|
* been printed and just before readline starts reading input
|
|
|
|
* characters.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_pre_input_hook variable.
|
2012-09-03 20:57:31 -04:00
|
|
|
*
|
2012-05-01 09:21:55 -04:00
|
|
|
* Raises ArgumentError if +proc+ does not respond to the call method.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2012-05-01 09:21:55 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_set_pre_input_hook(VALUE self, VALUE proc)
|
|
|
|
{
|
2016-10-03 03:10:49 -04:00
|
|
|
mustbe_callable(proc);
|
2012-05-01 09:21:55 -04:00
|
|
|
return rb_ivar_set(mReadline, id_pre_input_hook, proc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.pre_input_hook -> proc
|
|
|
|
*
|
|
|
|
* Returns a Proc object +proc+ to call after the first prompt has
|
|
|
|
* been printed and just before readline starts reading input
|
|
|
|
* characters. The default is nil.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2012-05-01 09:21:55 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_pre_input_hook(VALUE self)
|
|
|
|
{
|
|
|
|
return rb_attr_get(mReadline, id_pre_input_hook);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
readline_pre_input_hook(void)
|
|
|
|
{
|
|
|
|
VALUE proc;
|
|
|
|
|
|
|
|
proc = rb_attr_get(mReadline, id_pre_input_hook);
|
|
|
|
if (!NIL_P(proc))
|
2016-10-03 03:10:49 -04:00
|
|
|
rb_funcall(proc, id_call, 0);
|
2012-05-01 09:21:55 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_set_pre_input_hook rb_f_notimplement
|
|
|
|
#define readline_s_get_pre_input_hook rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_RL_INSERT_TEXT)
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.insert_text(string) -> self
|
|
|
|
*
|
|
|
|
* Insert text into the line at the current cursor position.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_insert_text function.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2012-05-01 09:21:55 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_insert_text(VALUE self, VALUE str)
|
|
|
|
{
|
|
|
|
OutputStringValue(str);
|
|
|
|
rl_insert_text(RSTRING_PTR(str));
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_insert_text rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2013-07-21 20:37:10 -04:00
|
|
|
#if defined(HAVE_RL_DELETE_TEXT)
|
2018-10-07 05:17:59 -04:00
|
|
|
int rl_delete_text(int, int);
|
2016-11-17 06:52:11 -05:00
|
|
|
static const char *
|
|
|
|
str_subpos(const char *ptr, const char *end, long beg, long *sublen, rb_encoding *enc)
|
|
|
|
{
|
|
|
|
VALUE str = rb_enc_str_new_static(ptr, end-ptr, enc);
|
|
|
|
OBJ_FREEZE(str);
|
|
|
|
ptr = rb_str_subpos(str, beg, sublen);
|
|
|
|
rb_gc_force_recycle(str);
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
2013-07-21 20:37:10 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.delete_text([start[, length]]) -> self
|
|
|
|
* Readline.delete_text(start..end) -> self
|
|
|
|
* Readline.delete_text() -> self
|
|
|
|
*
|
|
|
|
* Delete text between start and end in the current line.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_delete_text function.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2013-07-21 20:37:10 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_delete_text(int argc, VALUE *argv, VALUE self)
|
|
|
|
{
|
|
|
|
rb_check_arity(argc, 0, 2);
|
|
|
|
if (rl_line_buffer) {
|
2016-11-17 06:52:11 -05:00
|
|
|
const char *p, *ptr = rl_line_buffer;
|
|
|
|
long beg = 0, len = strlen(ptr);
|
|
|
|
const char *end = ptr + len;
|
|
|
|
rb_encoding *enc = rb_locale_encoding();
|
2013-08-06 09:07:25 -04:00
|
|
|
if (argc == 2) {
|
|
|
|
beg = NUM2LONG(argv[0]);
|
|
|
|
len = NUM2LONG(argv[1]);
|
|
|
|
num_pos:
|
2016-11-17 06:52:11 -05:00
|
|
|
p = str_subpos(ptr, end, beg, &len, enc);
|
2013-08-06 09:07:25 -04:00
|
|
|
if (!p) rb_raise(rb_eArgError, "invalid index");
|
|
|
|
beg = p - ptr;
|
|
|
|
}
|
|
|
|
else if (argc == 1) {
|
2016-11-17 06:52:11 -05:00
|
|
|
len = rb_enc_strlen(ptr, ptr + len, enc);
|
2013-08-06 09:07:25 -04:00
|
|
|
if (!rb_range_beg_len(argv[0], &beg, &len, len, 1)) {
|
|
|
|
beg = NUM2LONG(argv[0]);
|
|
|
|
goto num_pos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rl_delete_text(rb_long2int(beg), rb_long2int(beg + len));
|
2013-07-21 20:37:10 -04:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_delete_text rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2012-05-01 09:21:55 -04:00
|
|
|
#if defined(HAVE_RL_REDISPLAY)
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.redisplay -> self
|
|
|
|
*
|
|
|
|
* Change what's displayed on the screen to reflect the current
|
|
|
|
* contents.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_redisplay function.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2012-05-01 09:21:55 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_redisplay(VALUE self)
|
|
|
|
{
|
|
|
|
rl_redisplay();
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_redisplay rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_proc = proc
|
|
|
|
*
|
2011-07-22 00:52:22 -04:00
|
|
|
* Specifies a Proc object +proc+ to determine completion behavior. It
|
|
|
|
* should take input string and return an array of completion candidates.
|
2008-08-07 11:06:36 -04:00
|
|
|
*
|
2011-07-22 00:52:22 -04:00
|
|
|
* The default completion is used if +proc+ is nil.
|
2009-02-03 07:15:20 -05:00
|
|
|
*
|
2011-07-22 00:52:22 -04:00
|
|
|
* The String that is passed to the Proc depends on the
|
|
|
|
* Readline.completer_word_break_characters property. By default the word
|
|
|
|
* under the cursor is passed to the Proc. For example, if the input is "foo
|
|
|
|
* bar" then only "bar" would be passed to the completion Proc.
|
2008-08-07 11:06:36 -04:00
|
|
|
*
|
2011-07-22 00:52:22 -04:00
|
|
|
* Upon successful completion the Readline.completion_append_character will be
|
|
|
|
* appended to the input so the user can start working on their next argument.
|
|
|
|
*
|
|
|
|
* = Examples
|
|
|
|
*
|
|
|
|
* == Completion for a Static List
|
|
|
|
*
|
|
|
|
* require 'readline'
|
|
|
|
*
|
|
|
|
* LIST = [
|
|
|
|
* 'search', 'download', 'open',
|
|
|
|
* 'help', 'history', 'quit',
|
|
|
|
* 'url', 'next', 'clear',
|
|
|
|
* 'prev', 'past'
|
|
|
|
* ].sort
|
|
|
|
*
|
|
|
|
* comp = proc { |s| LIST.grep(/^#{Regexp.escape(s)}/) }
|
|
|
|
*
|
|
|
|
* Readline.completion_append_character = " "
|
|
|
|
* Readline.completion_proc = comp
|
|
|
|
*
|
|
|
|
* while line = Readline.readline('> ', true)
|
|
|
|
* p line
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* == Completion For Directory Contents
|
|
|
|
*
|
|
|
|
* require 'readline'
|
|
|
|
*
|
|
|
|
* Readline.completion_append_character = " "
|
|
|
|
* Readline.completion_proc = Proc.new do |str|
|
|
|
|
* Dir[str+'*'].grep(/^#{Regexp.escape(str)}/)
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* while line = Readline.readline('> ', true)
|
|
|
|
* p line
|
|
|
|
* end
|
|
|
|
*
|
|
|
|
* = Autocomplete strategies
|
|
|
|
*
|
|
|
|
* When working with auto-complete there are some strategies that work well.
|
|
|
|
* To get some ideas you can take a look at the
|
2019-05-07 10:16:26 -04:00
|
|
|
* completion.rb[https://git.ruby-lang.org/ruby.git/tree/lib/irb/completion.rb]
|
2011-07-22 00:52:22 -04:00
|
|
|
* file for irb.
|
|
|
|
*
|
|
|
|
* The common strategy is to take a list of possible completions and filter it
|
|
|
|
* down to those completions that start with the user input. In the above
|
|
|
|
* examples Enumerator.grep is used. The input is escaped to prevent Regexp
|
|
|
|
* special characters from interfering with the matching.
|
|
|
|
*
|
|
|
|
* It may also be helpful to use the Abbrev library to generate completions.
|
|
|
|
*
|
|
|
|
* Raises ArgumentError if +proc+ does not respond to the call method.
|
2008-08-07 11:06:36 -04:00
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_completion_proc(VALUE self, VALUE proc)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2016-10-03 03:10:49 -04:00
|
|
|
mustbe_callable(proc);
|
2005-01-16 17:09:29 -05:00
|
|
|
return rb_ivar_set(mReadline, completion_proc, proc);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_proc -> proc
|
|
|
|
*
|
|
|
|
* Returns the completion Proc object.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_get_completion_proc(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-01-16 17:09:29 -05:00
|
|
|
return rb_attr_get(mReadline, completion_proc);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2016-10-03 04:20:07 -04:00
|
|
|
#ifdef HAVE_RL_CHAR_IS_QUOTED_P
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.quoting_detection_proc = proc
|
|
|
|
*
|
|
|
|
* Specifies a Proc object +proc+ to determine if a character in the user's
|
|
|
|
* input is escaped. It should take the user's input and the index of the
|
|
|
|
* character in question as input, and return a boolean (true if the specified
|
|
|
|
* character is escaped).
|
|
|
|
*
|
|
|
|
* Readline will only call this proc with characters specified in
|
|
|
|
* +completer_quote_characters+, to discover if they indicate the end of a
|
|
|
|
* quoted argument, or characters specified in
|
|
|
|
* +completer_word_break_characters+, to discover if they indicate a break
|
|
|
|
* between arguments.
|
|
|
|
*
|
|
|
|
* If +completer_quote_characters+ is not set, or if the user input doesn't
|
|
|
|
* contain one of the +completer_quote_characters+ or a +\+ character,
|
|
|
|
* Readline will not attempt to use this proc at all.
|
|
|
|
*
|
|
|
|
* Raises ArgumentError if +proc+ does not respond to the call method.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_set_quoting_detection_proc(VALUE self, VALUE proc)
|
|
|
|
{
|
|
|
|
mustbe_callable(proc);
|
|
|
|
return rb_ivar_set(mReadline, quoting_detection_proc, proc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.quoting_detection_proc -> proc
|
|
|
|
*
|
|
|
|
* Returns the quoting detection Proc object.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_quoting_detection_proc(VALUE self)
|
|
|
|
{
|
|
|
|
return rb_attr_get(mReadline, quoting_detection_proc);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_set_quoting_detection_proc rb_f_notimplement
|
|
|
|
#define readline_s_get_quoting_detection_proc rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_case_fold = bool
|
|
|
|
*
|
|
|
|
* Sets whether or not to ignore case on completion.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_completion_case_fold(VALUE self, VALUE val)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-01-16 17:09:29 -05:00
|
|
|
return rb_ivar_set(mReadline, completion_case_fold, val);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_case_fold -> bool
|
|
|
|
*
|
|
|
|
* Returns true if completion ignores case. If no, returns false.
|
|
|
|
*
|
|
|
|
* NOTE: Returns the same object that is specified by
|
|
|
|
* Readline.completion_case_fold= method.
|
|
|
|
*
|
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* Readline.completion_case_fold = "This is a String."
|
|
|
|
* p Readline.completion_case_fold # => "This is a String."
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_get_completion_case_fold(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-01-16 17:09:29 -05:00
|
|
|
return rb_attr_get(mReadline, completion_case_fold);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2009-07-10 08:13:18 -04:00
|
|
|
#ifdef HAVE_RL_LINE_BUFFER
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.line_buffer -> string
|
|
|
|
*
|
|
|
|
* Returns the full line that is being edited. This is useful from
|
|
|
|
* within the complete_proc for determining the context of the
|
|
|
|
* completion request.
|
|
|
|
*
|
|
|
|
* The length of +Readline.line_buffer+ and GNU Readline's rl_end are
|
|
|
|
* same.
|
2013-08-06 09:19:19 -04:00
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2009-07-10 08:13:18 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_line_buffer(VALUE self)
|
|
|
|
{
|
|
|
|
if (rl_line_buffer == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2010-09-05 21:38:51 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_line_buffer);
|
2009-07-10 08:13:18 -04:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_get_line_buffer rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_RL_POINT
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.point -> int
|
|
|
|
*
|
|
|
|
* Returns the index of the current cursor position in
|
|
|
|
* +Readline.line_buffer+.
|
|
|
|
*
|
|
|
|
* The index in +Readline.line_buffer+ which matches the start of
|
|
|
|
* input-string passed to completion_proc is computed by subtracting
|
|
|
|
* the length of input-string from +Readline.point+.
|
|
|
|
*
|
|
|
|
* start = (the length of input-string) - Readline.point
|
2013-08-06 09:19:19 -04:00
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
2009-07-10 08:13:18 -04:00
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_point(VALUE self)
|
|
|
|
{
|
|
|
|
return INT2NUM(rl_point);
|
|
|
|
}
|
2013-08-06 08:52:22 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.point = int
|
|
|
|
*
|
|
|
|
* Set the index of the current cursor position in
|
|
|
|
* +Readline.line_buffer+.
|
|
|
|
*
|
2013-08-06 09:19:19 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*
|
2013-08-06 08:52:22 -04:00
|
|
|
* See +Readline.point+.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_set_point(VALUE self, VALUE pos)
|
|
|
|
{
|
|
|
|
rl_point = NUM2INT(pos);
|
|
|
|
return pos;
|
|
|
|
}
|
2009-07-10 08:13:18 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_point rb_f_notimplement
|
2013-08-06 08:52:22 -04:00
|
|
|
#define readline_s_set_point rb_f_notimplement
|
2009-07-10 08:13:18 -04:00
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static char **
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_attempted_completion_function(const char *text, int start, int end)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
VALUE proc, ary, temp;
|
|
|
|
char **result;
|
|
|
|
int case_fold;
|
2009-07-10 18:12:07 -04:00
|
|
|
long i, matches;
|
2012-01-28 22:18:11 -05:00
|
|
|
rb_encoding *enc;
|
|
|
|
VALUE encobj;
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2005-01-16 17:09:29 -05:00
|
|
|
proc = rb_attr_get(mReadline, completion_proc);
|
1999-08-13 01:37:52 -04:00
|
|
|
if (NIL_P(proc))
|
2013-08-06 09:07:25 -04:00
|
|
|
return NULL;
|
2011-12-23 02:38:14 -05:00
|
|
|
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
|
|
|
rl_completion_append_character = readline_completion_append_character;
|
|
|
|
#endif
|
2005-05-19 10:36:20 -04:00
|
|
|
#ifdef HAVE_RL_ATTEMPTED_COMPLETION_OVER
|
1999-01-19 23:59:32 -05:00
|
|
|
rl_attempted_completion_over = 1;
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
2005-01-16 17:09:29 -05:00
|
|
|
case_fold = RTEST(rb_attr_get(mReadline, completion_case_fold));
|
2016-10-03 03:10:49 -04:00
|
|
|
ary = rb_funcall(proc, id_call, 1, rb_locale_str_new_cstr(text));
|
2012-01-09 22:14:52 -05:00
|
|
|
if (!RB_TYPE_P(ary, T_ARRAY))
|
2013-08-06 09:07:25 -04:00
|
|
|
ary = rb_Array(ary);
|
2006-09-02 10:42:08 -04:00
|
|
|
matches = RARRAY_LEN(ary);
|
2012-01-09 20:41:15 -05:00
|
|
|
if (matches == 0) return NULL;
|
2012-01-08 16:02:08 -05:00
|
|
|
result = (char**)malloc((matches + 2)*sizeof(char*));
|
2012-01-10 01:14:42 -05:00
|
|
|
if (result == NULL) rb_memerror();
|
2012-01-28 22:18:11 -05:00
|
|
|
enc = rb_locale_encoding();
|
|
|
|
encobj = rb_enc_from_encoding(enc);
|
1999-01-19 23:59:32 -05:00
|
|
|
for (i = 0; i < matches; i++) {
|
2015-11-04 20:09:17 -05:00
|
|
|
temp = rb_obj_as_string(RARRAY_AREF(ary, i));
|
2013-08-06 09:07:25 -04:00
|
|
|
StringValueCStr(temp); /* must be NUL-terminated */
|
|
|
|
rb_enc_check(encobj, temp);
|
|
|
|
result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1);
|
|
|
|
if (result[i + 1] == NULL) rb_memerror();
|
|
|
|
strcpy(result[i + 1], RSTRING_PTR(temp));
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
result[matches + 1] = NULL;
|
|
|
|
|
|
|
|
if (matches == 1) {
|
2005-05-20 02:57:06 -04:00
|
|
|
result[0] = strdup(result[1]);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
const char *result1 = result[1];
|
|
|
|
long low = strlen(result1);
|
|
|
|
|
|
|
|
for (i = 1; i < matches; ++i) {
|
|
|
|
register int c1, c2;
|
|
|
|
long i1, i2, l2;
|
|
|
|
int n1, n2;
|
|
|
|
const char *p2 = result[i + 1];
|
|
|
|
|
|
|
|
l2 = strlen(p2);
|
|
|
|
for (i1 = i2 = 0; i1 < low && i2 < l2; i1 += n1, i2 += n2) {
|
|
|
|
c1 = rb_enc_codepoint_len(result1 + i1, result1 + low, &n1, enc);
|
|
|
|
c2 = rb_enc_codepoint_len(p2 + i2, p2 + l2, &n2, enc);
|
|
|
|
if (case_fold) {
|
|
|
|
c1 = rb_tolower(c1);
|
|
|
|
c2 = rb_tolower(c2);
|
|
|
|
}
|
|
|
|
if (c1 != c2) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
low = i1;
|
|
|
|
}
|
|
|
|
result[0] = (char*)malloc(low + 1);
|
|
|
|
if (result[0] == NULL) rb_memerror();
|
|
|
|
strncpy(result[0], result[1], low);
|
|
|
|
result[0][low] = '\0';
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-10-03 04:20:07 -04:00
|
|
|
#ifdef HAVE_RL_CHAR_IS_QUOTED_P
|
|
|
|
static int
|
|
|
|
readline_char_is_quoted(char *text, int byte_index)
|
|
|
|
{
|
|
|
|
VALUE proc, result, str;
|
|
|
|
long char_index;
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
proc = rb_attr_get(mReadline, quoting_detection_proc);
|
|
|
|
if (NIL_P(proc)) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
len = strlen(text);
|
|
|
|
if (byte_index < 0 || len < (size_t)byte_index) {
|
|
|
|
rb_raise(rb_eIndexError, "invalid byte index (%d in %"PRIdSIZE")",
|
|
|
|
byte_index, len);
|
|
|
|
}
|
|
|
|
|
2016-10-03 08:39:10 -04:00
|
|
|
str = rb_locale_str_new(text, len);
|
2016-10-03 04:20:07 -04:00
|
|
|
char_index = rb_str_sublen(str, byte_index);
|
|
|
|
result = rb_funcall(proc, id_call, 2, str, LONG2FIX(char_index));
|
|
|
|
return RTEST(result);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_SET_SCREEN_SIZE
|
2009-02-03 07:21:08 -05:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.set_screen_size(rows, columns) -> self
|
|
|
|
*
|
|
|
|
* Set terminal size to +rows+ and +columns+.
|
|
|
|
*
|
2010-04-22 04:04:13 -04:00
|
|
|
* See GNU Readline's rl_set_screen_size function.
|
2009-02-03 07:21:08 -05:00
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_set_screen_size(VALUE self, VALUE rows, VALUE columns)
|
|
|
|
{
|
|
|
|
rl_set_screen_size(NUM2INT(rows), NUM2INT(columns));
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_screen_size rb_f_notimplement
|
|
|
|
#endif
|
2009-02-03 07:21:08 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_GET_SCREEN_SIZE
|
2009-02-03 07:21:08 -05:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.get_screen_size -> [rows, columns]
|
|
|
|
*
|
|
|
|
* Returns the terminal's rows and columns.
|
|
|
|
*
|
2010-04-22 04:04:13 -04:00
|
|
|
* See GNU Readline's rl_get_screen_size function.
|
2009-02-03 07:21:08 -05:00
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_screen_size(VALUE self)
|
|
|
|
{
|
|
|
|
int rows, columns;
|
|
|
|
VALUE res;
|
2010-04-22 04:04:13 -04:00
|
|
|
|
2009-02-03 07:21:08 -05:00
|
|
|
rl_get_screen_size(&rows, &columns);
|
|
|
|
res = rb_ary_new();
|
|
|
|
rb_ary_push(res, INT2NUM(rows));
|
|
|
|
rb_ary_push(res, INT2NUM(columns));
|
|
|
|
return res;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_screen_size rb_f_notimplement
|
|
|
|
#endif
|
2009-02-03 07:21:08 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_VI_EDITING_MODE
|
2018-10-07 05:17:59 -04:00
|
|
|
int rl_vi_editing_mode(int, int);
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.vi_editing_mode -> nil
|
|
|
|
*
|
|
|
|
* Specifies VI editing mode. See the manual of GNU Readline for
|
|
|
|
* details of VI editing mode.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_vi_editing_mode(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
1999-08-13 01:37:52 -04:00
|
|
|
rl_vi_editing_mode(1,0);
|
1999-01-19 23:59:32 -05:00
|
|
|
return Qnil;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_vi_editing_mode rb_f_notimplement
|
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_EDITING_MODE
|
2008-08-11 04:31:45 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.vi_editing_mode? -> bool
|
|
|
|
*
|
|
|
|
* Returns true if vi mode is active. Returns false if not.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_vi_editing_mode_p(VALUE self)
|
|
|
|
{
|
|
|
|
return rl_editing_mode == 0 ? Qtrue : Qfalse;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_vi_editing_mode_p rb_f_notimplement
|
|
|
|
#endif
|
2008-08-11 04:31:45 -04:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_EMACS_EDITING_MODE
|
2018-10-07 05:17:59 -04:00
|
|
|
int rl_emacs_editing_mode(int, int);
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.emacs_editing_mode -> nil
|
|
|
|
*
|
|
|
|
* Specifies Emacs editing mode. The default is this mode. See the
|
|
|
|
* manual of GNU Readline for details of Emacs editing mode.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_emacs_editing_mode(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
1999-08-13 01:37:52 -04:00
|
|
|
rl_emacs_editing_mode(1,0);
|
1999-01-19 23:59:32 -05:00
|
|
|
return Qnil;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_emacs_editing_mode rb_f_notimplement
|
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_EDITING_MODE
|
2008-08-11 04:31:45 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.emacs_editing_mode? -> bool
|
|
|
|
*
|
|
|
|
* Returns true if emacs mode is active. Returns false if not.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_emacs_editing_mode_p(VALUE self)
|
|
|
|
{
|
|
|
|
return rl_editing_mode == 1 ? Qtrue : Qfalse;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_emacs_editing_mode_p rb_f_notimplement
|
|
|
|
#endif
|
2008-08-11 04:31:45 -04:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_append_character = char
|
|
|
|
*
|
|
|
|
* Specifies a character to be appended on completion.
|
|
|
|
* Nothing will be appended if an empty string ("") or nil is
|
|
|
|
* specified.
|
|
|
|
*
|
|
|
|
* For example:
|
|
|
|
* require "readline"
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* Readline.readline("> ", true)
|
|
|
|
* Readline.completion_append_character = " "
|
|
|
|
*
|
|
|
|
* Result:
|
|
|
|
* >
|
|
|
|
* Input "/var/li".
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* > /var/li
|
|
|
|
* Press TAB key.
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* > /var/lib
|
|
|
|
* Completes "b" and appends " ". So, you can continuously input "/usr".
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* > /var/lib /usr
|
|
|
|
*
|
|
|
|
* NOTE: Only one character can be specified. When "string" is
|
|
|
|
* specified, sets only "s" that is the first.
|
|
|
|
*
|
|
|
|
* require "readline"
|
|
|
|
*
|
|
|
|
* Readline.completion_append_character = "string"
|
|
|
|
* p Readline.completion_append_character # => "s"
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-06-19 05:21:38 -04:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_completion_append_character(VALUE self, VALUE str)
|
2001-06-19 05:21:38 -04:00
|
|
|
{
|
2004-11-18 20:38:38 -05:00
|
|
|
if (NIL_P(str)) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rl_completion_append_character = '\0';
|
2004-11-18 20:38:38 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
OutputStringValue(str);
|
|
|
|
if (RSTRING_LEN(str) == 0) {
|
|
|
|
rl_completion_append_character = '\0';
|
|
|
|
} else {
|
|
|
|
rl_completion_append_character = RSTRING_PTR(str)[0];
|
|
|
|
}
|
2001-06-19 05:21:38 -04:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_completion_append_character rb_f_notimplement
|
|
|
|
#endif
|
2001-06-19 05:21:38 -04:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_append_character -> char
|
|
|
|
*
|
|
|
|
* Returns a string containing a character to be appended on
|
|
|
|
* completion. The default is a space (" ").
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-06-19 05:21:38 -04:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_get_completion_append_character(VALUE self)
|
2001-06-19 05:21:38 -04:00
|
|
|
{
|
2008-12-12 11:13:11 -05:00
|
|
|
char buf[1];
|
2001-06-19 05:21:38 -04:00
|
|
|
|
|
|
|
if (rl_completion_append_character == '\0')
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2001-06-19 05:21:38 -04:00
|
|
|
|
2008-12-12 11:13:11 -05:00
|
|
|
buf[0] = (char) rl_completion_append_character;
|
|
|
|
return rb_locale_str_new(buf, 1);
|
2001-09-06 01:14:06 -04:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_completion_append_character rb_f_notimplement
|
|
|
|
#endif
|
2001-09-06 01:14:06 -04:00
|
|
|
|
2018-09-02 19:27:08 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETION_QUOTE_CHARACTER
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completion_quote_character -> char
|
|
|
|
*
|
|
|
|
* When called during a completion (e.g. from within your completion_proc),
|
2018-10-12 16:37:30 -04:00
|
|
|
* it will return a string containing the character used to quote the
|
2018-09-02 19:27:08 -04:00
|
|
|
* argument being completed, or nil if the argument is unquoted.
|
|
|
|
*
|
|
|
|
* When called at other times, it will always return nil.
|
|
|
|
*
|
2018-10-12 16:37:30 -04:00
|
|
|
* Note that Readline.completer_quote_characters must be set,
|
2018-09-02 19:27:08 -04:00
|
|
|
* or this method will always return nil.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_completion_quote_character(VALUE self)
|
|
|
|
{
|
|
|
|
char buf[1];
|
|
|
|
|
|
|
|
if (rl_completion_quote_character == '\0')
|
|
|
|
return Qnil;
|
|
|
|
|
|
|
|
buf[0] = (char) rl_completion_quote_character;
|
|
|
|
return rb_locale_str_new(buf, 1);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_get_completion_quote_character rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.basic_word_break_characters = string
|
|
|
|
*
|
|
|
|
* Sets the basic list of characters that signal a break between words
|
|
|
|
* for the completer routine. The default is the characters which
|
2012-07-16 09:08:04 -04:00
|
|
|
* break words for completion in Bash: " \t\n\"\\'`@$><=;|&{(".
|
2008-08-07 11:06:36 -04:00
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
static char *basic_word_break_characters = NULL;
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-12-19 03:02:55 -05:00
|
|
|
if (basic_word_break_characters == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
basic_word_break_characters =
|
|
|
|
ALLOC_N(char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
REALLOC_N(basic_word_break_characters, char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
strncpy(basic_word_break_characters,
|
2013-08-06 09:07:25 -04:00
|
|
|
RSTRING_PTR(str), RSTRING_LEN(str));
|
2006-08-31 06:30:33 -04:00
|
|
|
basic_word_break_characters[RSTRING_LEN(str)] = '\0';
|
2001-12-19 03:02:55 -05:00
|
|
|
rl_basic_word_break_characters = basic_word_break_characters;
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_basic_word_break_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.basic_word_break_characters -> string
|
|
|
|
*
|
|
|
|
* Gets the basic list of characters that signal a break between words
|
|
|
|
* for the completer routine.
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
2019-08-28 22:47:20 -04:00
|
|
|
readline_s_get_basic_word_break_characters(VALUE self)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
if (rl_basic_word_break_characters == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_basic_word_break_characters);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_basic_word_break_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completer_word_break_characters = string
|
|
|
|
*
|
|
|
|
* Sets the basic list of characters that signal a break between words
|
|
|
|
* for rl_complete_internal(). The default is the value of
|
|
|
|
* Readline.basic_word_break_characters.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
static char *completer_word_break_characters = NULL;
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-12-19 03:02:55 -05:00
|
|
|
if (completer_word_break_characters == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
completer_word_break_characters =
|
|
|
|
ALLOC_N(char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
REALLOC_N(completer_word_break_characters, char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
strncpy(completer_word_break_characters,
|
2013-08-06 09:07:25 -04:00
|
|
|
RSTRING_PTR(str), RSTRING_LEN(str));
|
2006-08-31 06:30:33 -04:00
|
|
|
completer_word_break_characters[RSTRING_LEN(str)] = '\0';
|
2001-12-19 03:02:55 -05:00
|
|
|
rl_completer_word_break_characters = completer_word_break_characters;
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_completer_word_break_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completer_word_break_characters -> string
|
|
|
|
*
|
|
|
|
* Gets the basic list of characters that signal a break between words
|
|
|
|
* for rl_complete_internal().
|
2010-04-22 04:04:13 -04:00
|
|
|
*
|
2008-08-07 11:06:36 -04:00
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
2019-08-28 22:47:20 -04:00
|
|
|
readline_s_get_completer_word_break_characters(VALUE self)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
if (rl_completer_word_break_characters == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_completer_word_break_characters);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_completer_word_break_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2012-05-01 20:47:57 -04:00
|
|
|
#if defined(HAVE_RL_SPECIAL_PREFIXES)
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.special_prefixes = string
|
|
|
|
*
|
|
|
|
* Sets the list of characters that are word break characters, but
|
|
|
|
* should be left in text when it is passed to the completion
|
|
|
|
* function. Programs can use this to help determine what kind of
|
|
|
|
* completing to do. For instance, Bash sets this variable to "$@" so
|
|
|
|
* that it can complete shell variables and hostnames.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_special_prefixes variable.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_set_special_prefixes(VALUE self, VALUE str)
|
|
|
|
{
|
|
|
|
if (!NIL_P(str)) {
|
2013-08-06 09:07:25 -04:00
|
|
|
OutputStringValue(str);
|
|
|
|
str = rb_str_dup_frozen(str);
|
|
|
|
rb_obj_hide(str);
|
2012-05-01 20:47:57 -04:00
|
|
|
}
|
|
|
|
rb_ivar_set(mReadline, id_special_prefixes, str);
|
|
|
|
if (NIL_P(str)) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rl_special_prefixes = NULL;
|
2012-05-01 20:47:57 -04:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
rl_special_prefixes = RSTRING_PTR(str);
|
2012-05-01 20:47:57 -04:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.special_prefixes -> string
|
|
|
|
*
|
|
|
|
* Gets the list of characters that are word break characters, but
|
|
|
|
* should be left in text when it is passed to the completion
|
|
|
|
* function.
|
|
|
|
*
|
|
|
|
* See GNU Readline's rl_special_prefixes variable.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
|
|
|
static VALUE
|
|
|
|
readline_s_get_special_prefixes(VALUE self)
|
|
|
|
{
|
|
|
|
VALUE str;
|
2012-06-18 22:58:43 -04:00
|
|
|
if (rl_special_prefixes == NULL) return Qnil;
|
2012-05-01 20:47:57 -04:00
|
|
|
str = rb_ivar_get(mReadline, id_special_prefixes);
|
|
|
|
if (!NIL_P(str)) {
|
2013-08-06 09:07:25 -04:00
|
|
|
str = rb_str_dup_frozen(str);
|
|
|
|
rb_obj_reveal(str, rb_cString);
|
2012-05-01 20:47:57 -04:00
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_set_special_prefixes rb_f_notimplement
|
|
|
|
#define readline_s_get_special_prefixes rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.basic_quote_characters = string
|
|
|
|
*
|
|
|
|
* Sets a list of quote characters which can cause a word break.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_basic_quote_characters(VALUE self, VALUE str)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
static char *basic_quote_characters = NULL;
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-12-19 03:02:55 -05:00
|
|
|
if (basic_quote_characters == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
basic_quote_characters =
|
|
|
|
ALLOC_N(char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
REALLOC_N(basic_quote_characters, char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
strncpy(basic_quote_characters,
|
2013-08-06 09:07:25 -04:00
|
|
|
RSTRING_PTR(str), RSTRING_LEN(str));
|
2006-08-31 06:30:33 -04:00
|
|
|
basic_quote_characters[RSTRING_LEN(str)] = '\0';
|
2001-12-19 03:02:55 -05:00
|
|
|
rl_basic_quote_characters = basic_quote_characters;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_basic_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_BASIC_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.basic_quote_characters -> string
|
|
|
|
*
|
|
|
|
* Gets a list of quote characters which can cause a word break.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
2019-08-28 22:47:20 -04:00
|
|
|
readline_s_get_basic_quote_characters(VALUE self)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
if (rl_basic_quote_characters == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_basic_quote_characters);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_basic_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completer_quote_characters = string
|
|
|
|
*
|
|
|
|
* Sets a list of characters which can be used to quote a substring of
|
|
|
|
* the line. Completion occurs on the entire substring, and within
|
|
|
|
* the substring Readline.completer_word_break_characters are treated
|
|
|
|
* as any other character, unless they also appear within this list.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_completer_quote_characters(VALUE self, VALUE str)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
static char *completer_quote_characters = NULL;
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-12-19 03:02:55 -05:00
|
|
|
if (completer_quote_characters == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
completer_quote_characters =
|
|
|
|
ALLOC_N(char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
REALLOC_N(completer_quote_characters, char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2006-08-31 06:30:33 -04:00
|
|
|
strncpy(completer_quote_characters, RSTRING_PTR(str), RSTRING_LEN(str));
|
|
|
|
completer_quote_characters[RSTRING_LEN(str)] = '\0';
|
2001-12-19 03:02:55 -05:00
|
|
|
rl_completer_quote_characters = completer_quote_characters;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_completer_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_COMPLETER_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.completer_quote_characters -> string
|
|
|
|
*
|
|
|
|
* Gets a list of characters which can be used to quote a substring of
|
|
|
|
* the line.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
2019-08-28 22:47:20 -04:00
|
|
|
readline_s_get_completer_quote_characters(VALUE self)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
if (rl_completer_quote_characters == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_completer_quote_characters);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_completer_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.filename_quote_characters = string
|
|
|
|
*
|
|
|
|
* Sets a list of characters that cause a filename to be quoted by the completer
|
|
|
|
* when they appear in a completed filename. The default is nil.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
readline_s_set_filename_quote_characters(VALUE self, VALUE str)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
static char *filename_quote_characters = NULL;
|
|
|
|
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-12-19 03:02:55 -05:00
|
|
|
if (filename_quote_characters == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
filename_quote_characters =
|
|
|
|
ALLOC_N(char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
REALLOC_N(filename_quote_characters, char, RSTRING_LEN(str) + 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
}
|
2006-08-31 06:30:33 -04:00
|
|
|
strncpy(filename_quote_characters, RSTRING_PTR(str), RSTRING_LEN(str));
|
|
|
|
filename_quote_characters[RSTRING_LEN(str)] = '\0';
|
2001-12-19 03:02:55 -05:00
|
|
|
rl_filename_quote_characters = filename_quote_characters;
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_set_filename_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-12-19 03:02:55 -05:00
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_RL_FILENAME_QUOTE_CHARACTERS
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.filename_quote_characters -> string
|
|
|
|
*
|
|
|
|
* Gets a list of characters that cause a filename to be quoted by the completer
|
|
|
|
* when they appear in a completed filename.
|
|
|
|
*
|
|
|
|
* Raises NotImplementedError if the using readline library does not support.
|
|
|
|
*/
|
2001-12-19 03:02:55 -05:00
|
|
|
static VALUE
|
2019-08-28 22:47:20 -04:00
|
|
|
readline_s_get_filename_quote_characters(VALUE self)
|
2001-12-19 03:02:55 -05:00
|
|
|
{
|
|
|
|
if (rl_filename_quote_characters == NULL)
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(rl_filename_quote_characters);
|
2001-06-19 05:21:38 -04:00
|
|
|
}
|
2009-04-18 10:10:06 -04:00
|
|
|
#else
|
|
|
|
#define readline_s_get_filename_quote_characters rb_f_notimplement
|
|
|
|
#endif
|
2001-06-19 05:21:38 -04:00
|
|
|
|
2009-07-10 09:03:40 -04:00
|
|
|
#ifdef HAVE_RL_REFRESH_LINE
|
2018-10-07 05:17:59 -04:00
|
|
|
int rl_refresh_line(int, int);
|
2009-07-10 09:03:40 -04:00
|
|
|
/*
|
|
|
|
* call-seq:
|
|
|
|
* Readline.refresh_line -> nil
|
|
|
|
*
|
|
|
|
* Clear the current input line.
|
|
|
|
*/
|
|
|
|
static VALUE
|
2009-07-10 18:12:07 -04:00
|
|
|
readline_s_refresh_line(VALUE self)
|
2009-07-10 09:03:40 -04:00
|
|
|
{
|
2015-01-14 01:43:50 -05:00
|
|
|
prepare_readline();
|
2009-07-10 18:12:07 -04:00
|
|
|
rl_refresh_line(0, 0);
|
|
|
|
return Qnil;
|
2009-07-10 09:03:40 -04:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define readline_s_refresh_line rb_f_notimplement
|
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_to_s(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_str_new_cstr("HISTORY");
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2008-08-01 11:04:37 -04:00
|
|
|
static int
|
|
|
|
history_get_offset_history_base(int offset)
|
|
|
|
{
|
|
|
|
return history_base + offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
history_get_offset_0(int offset)
|
|
|
|
{
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_get(VALUE self, VALUE index)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-08-01 11:04:37 -04:00
|
|
|
HIST_ENTRY *entry = NULL;
|
1999-01-19 23:59:32 -05:00
|
|
|
int i;
|
|
|
|
|
|
|
|
i = NUM2INT(index);
|
2001-09-06 01:14:06 -04:00
|
|
|
if (i < 0) {
|
2005-05-19 10:36:20 -04:00
|
|
|
i += history_length;
|
2001-09-06 01:14:06 -04:00
|
|
|
}
|
2008-08-01 11:04:37 -04:00
|
|
|
if (i >= 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
entry = history_get(history_get_offset_func(i));
|
2008-08-01 11:04:37 -04:00
|
|
|
}
|
2005-05-19 10:36:20 -04:00
|
|
|
if (entry == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rb_raise(rb_eIndexError, "invalid index");
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2008-10-22 01:55:22 -04:00
|
|
|
return rb_locale_str_new_cstr(entry->line);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_REPLACE_HISTORY_ENTRY
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_set(VALUE self, VALUE index, VALUE str)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-08-01 11:04:37 -04:00
|
|
|
HIST_ENTRY *entry = NULL;
|
1999-01-19 23:59:32 -05:00
|
|
|
int i;
|
|
|
|
|
|
|
|
i = NUM2INT(index);
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2001-09-06 01:14:06 -04:00
|
|
|
if (i < 0) {
|
2005-05-19 10:36:20 -04:00
|
|
|
i += history_length;
|
2001-09-06 01:14:06 -04:00
|
|
|
}
|
2008-08-01 11:04:37 -04:00
|
|
|
if (i >= 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
entry = replace_history_entry(history_replace_offset_func(i), RSTRING_PTR(str), NULL);
|
2008-08-01 11:04:37 -04:00
|
|
|
}
|
2005-05-19 10:36:20 -04:00
|
|
|
if (entry == NULL) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rb_raise(rb_eIndexError, "invalid index");
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2005-05-19 12:26:50 -04:00
|
|
|
return str;
|
2009-04-18 10:10:06 -04:00
|
|
|
}
|
2005-05-19 10:36:20 -04:00
|
|
|
#else
|
2009-04-18 10:10:06 -04:00
|
|
|
#define hist_set rb_f_notimplement
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
1999-01-19 23:59:32 -05:00
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_push(VALUE self, VALUE str)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-12-12 07:44:08 -05:00
|
|
|
OutputStringValue(str);
|
2006-08-31 06:30:33 -04:00
|
|
|
add_history(RSTRING_PTR(str));
|
1999-01-19 23:59:32 -05:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_push_method(int argc, VALUE *argv, VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
VALUE str;
|
2010-04-22 04:04:13 -04:00
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
while (argc--) {
|
2013-08-06 09:07:25 -04:00
|
|
|
str = *argv++;
|
|
|
|
OutputStringValue(str);
|
|
|
|
add_history(RSTRING_PTR(str));
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2005-05-19 10:36:20 -04:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
rb_remove_history(int index)
|
2005-05-19 10:36:20 -04:00
|
|
|
{
|
|
|
|
#ifdef HAVE_REMOVE_HISTORY
|
|
|
|
HIST_ENTRY *entry;
|
|
|
|
VALUE val;
|
|
|
|
|
|
|
|
entry = remove_history(index);
|
|
|
|
if (entry) {
|
2008-10-22 01:55:22 -04:00
|
|
|
val = rb_locale_str_new_cstr(entry->line);
|
2008-08-01 11:04:37 -04:00
|
|
|
free((void *) entry->line);
|
2005-05-19 10:36:20 -04:00
|
|
|
free(entry);
|
|
|
|
return val;
|
|
|
|
}
|
2005-05-19 12:26:50 -04:00
|
|
|
return Qnil;
|
2005-05-19 10:36:20 -04:00
|
|
|
#else
|
|
|
|
rb_notimplement();
|
2012-04-13 20:36:26 -04:00
|
|
|
|
2018-07-24 01:38:07 -04:00
|
|
|
UNREACHABLE_RETURN(Qnil);
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_pop(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-05-19 10:36:20 -04:00
|
|
|
if (history_length > 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
return rb_remove_history(history_length - 1);
|
1999-01-19 23:59:32 -05:00
|
|
|
} else {
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_shift(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-05-19 10:36:20 -04:00
|
|
|
if (history_length > 0) {
|
2013-08-06 09:07:25 -04:00
|
|
|
return rb_remove_history(0);
|
1999-01-19 23:59:32 -05:00
|
|
|
} else {
|
2013-08-06 09:07:25 -04:00
|
|
|
return Qnil;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_each(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-05-19 10:36:20 -04:00
|
|
|
HIST_ENTRY *entry;
|
1999-01-19 23:59:32 -05:00
|
|
|
int i;
|
|
|
|
|
* ext/dbm/dbm.c (fdbm_each_value, fdbm_each_key, fdbm_each_pair):
GDBM#{each,each_pair,each_key,each_value}: Return an enumerator
if no block is given.
* ext/gdbm/gdbm.c (fgdbm_each_value, fgdbm_each_key,
fgdbm_each_pair): GDBM#{each,each_pair,each_key,each_value}:
Return an enumerator if no block is given.
* ext/openssl/ossl_config.c (ossl_config_each):
OpenSSL::Config#each: Return an enumerator if no block is given.
* ext/readline/readline.c (hist_each): Readline::HISTORY#each:
Return an enumerator if no block is given.
* ext/sdbm/init.c (fsdbm_each_value, fsdbm_each_key,
fsdbm_each_pair): SDBM#{each,each_pair,each_key,each_value}:
Return an enumerator if no block is given.
* ext/stringio/stringio.c (strio_each_byte, strio_each):
StringIO#{each,each_line,each_byte}: Return an enumerator if no
block is given.
* ext/stringio/stringio.c (Init_stringio): Add #lines and #bytes,
which are aliases to #each_line and #each_byte, respectively.
* ext/win32ole/win32ole.c (fole_each): WIN32OLE#each: Return an
enumerator if no block is given.
* ext/zlib/zlib.c (rb_gzreader_each_byte, rb_gzreader_each):
Zlib::GzipReader#{each,each_line,each_byte}: Return an
enumerator if no block is given.
* ext/zlib/zlib.c (Init_zlib): Add Zlib::GzipReader#lines and
#bytes, which are aliases to #each_line and #each_byte,
respectively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 04:48:33 -04:00
|
|
|
RETURN_ENUMERATOR(self, 0, 0);
|
|
|
|
|
2005-05-19 10:36:20 -04:00
|
|
|
for (i = 0; i < history_length; i++) {
|
2008-08-01 11:04:37 -04:00
|
|
|
entry = history_get(history_get_offset_func(i));
|
2005-05-19 10:36:20 -04:00
|
|
|
if (entry == NULL)
|
|
|
|
break;
|
2013-08-06 09:07:25 -04:00
|
|
|
rb_yield(rb_locale_str_new_cstr(entry->line));
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
1999-08-13 01:37:52 -04:00
|
|
|
return self;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_length(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-05-19 10:36:20 -04:00
|
|
|
return INT2NUM(history_length);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_empty_p(VALUE self)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2005-05-19 10:36:20 -04:00
|
|
|
return history_length == 0 ? Qtrue : Qfalse;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
hist_delete_at(VALUE self, VALUE index)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
i = NUM2INT(index);
|
2001-09-06 01:14:06 -04:00
|
|
|
if (i < 0)
|
2005-05-19 10:36:20 -04:00
|
|
|
i += history_length;
|
|
|
|
if (i < 0 || i > history_length - 1) {
|
2013-08-06 09:07:25 -04:00
|
|
|
rb_raise(rb_eIndexError, "invalid index");
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2001-09-06 01:14:06 -04:00
|
|
|
return rb_remove_history(i);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
|
2009-04-18 10:10:06 -04:00
|
|
|
#ifdef HAVE_CLEAR_HISTORY
|
2008-08-01 11:04:37 -04:00
|
|
|
static VALUE
|
|
|
|
hist_clear(VALUE self)
|
|
|
|
{
|
|
|
|
clear_history();
|
|
|
|
return self;
|
2009-04-18 10:10:06 -04:00
|
|
|
}
|
2008-08-01 11:04:37 -04:00
|
|
|
#else
|
2009-04-18 10:10:06 -04:00
|
|
|
#define hist_clear rb_f_notimplement
|
2008-08-01 11:04:37 -04:00
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
filename_completion_proc_call(VALUE self, VALUE str)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
VALUE result;
|
|
|
|
char **matches;
|
|
|
|
int i;
|
|
|
|
|
2001-05-07 05:26:29 -04:00
|
|
|
matches = rl_completion_matches(StringValuePtr(str),
|
2013-08-06 09:07:25 -04:00
|
|
|
rl_filename_completion_function);
|
1999-01-19 23:59:32 -05:00
|
|
|
if (matches) {
|
2013-08-06 09:07:25 -04:00
|
|
|
result = rb_ary_new();
|
|
|
|
for (i = 0; matches[i]; i++) {
|
|
|
|
rb_ary_push(result, rb_locale_str_new_cstr(matches[i]));
|
|
|
|
free(matches[i]);
|
|
|
|
}
|
|
|
|
free(matches);
|
|
|
|
if (RARRAY_LEN(result) >= 2)
|
|
|
|
rb_ary_shift(result);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
result = Qnil;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
static VALUE
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
username_completion_proc_call(VALUE self, VALUE str)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
|
|
|
VALUE result;
|
|
|
|
char **matches;
|
|
|
|
int i;
|
|
|
|
|
2001-05-07 05:26:29 -04:00
|
|
|
matches = rl_completion_matches(StringValuePtr(str),
|
2013-08-06 09:07:25 -04:00
|
|
|
rl_username_completion_function);
|
1999-01-19 23:59:32 -05:00
|
|
|
if (matches) {
|
2013-08-06 09:07:25 -04:00
|
|
|
result = rb_ary_new();
|
|
|
|
for (i = 0; matches[i]; i++) {
|
|
|
|
rb_ary_push(result, rb_locale_str_new_cstr(matches[i]));
|
|
|
|
free(matches[i]);
|
|
|
|
}
|
|
|
|
free(matches);
|
|
|
|
if (RARRAY_LEN(result) >= 2)
|
|
|
|
rb_ary_shift(result);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
else {
|
2013-08-06 09:07:25 -04:00
|
|
|
result = Qnil;
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2018-10-07 05:17:59 -04:00
|
|
|
#ifdef HAVE_RL_CLEAR_SIGNALS
|
|
|
|
int rl_clear_signals(void);
|
|
|
|
#endif
|
|
|
|
|
2016-10-03 03:10:49 -04:00
|
|
|
#undef rb_intern
|
1999-01-19 23:59:32 -05:00
|
|
|
void
|
2014-09-30 01:25:32 -04:00
|
|
|
Init_readline(void)
|
1999-01-19 23:59:32 -05:00
|
|
|
{
|
2008-08-07 11:06:36 -04:00
|
|
|
VALUE history, fcomp, ucomp, version;
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2001-09-06 01:14:06 -04:00
|
|
|
/* Allow conditional parsing of the ~/.inputrc file. */
|
2009-01-17 05:20:07 -05:00
|
|
|
rl_readline_name = (char *)"Ruby";
|
2001-09-06 01:14:06 -04:00
|
|
|
|
2011-12-23 02:02:42 -05:00
|
|
|
#if defined HAVE_RL_GETC_FUNCTION
|
|
|
|
/* libedit check rl_getc_function only when rl_initialize() is called, */
|
|
|
|
/* and using_history() call rl_initialize(). */
|
|
|
|
/* This assignment should be placed before using_history() */
|
|
|
|
rl_getc_function = readline_getc;
|
|
|
|
#elif defined HAVE_RL_EVENT_HOOK
|
|
|
|
rl_event_hook = readline_event;
|
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
using_history();
|
|
|
|
|
2016-10-03 03:10:49 -04:00
|
|
|
id_call = rb_intern("call");
|
2005-01-16 17:09:29 -05:00
|
|
|
completion_proc = rb_intern(COMPLETION_PROC);
|
|
|
|
completion_case_fold = rb_intern(COMPLETION_CASE_FOLD);
|
2012-05-01 09:21:55 -04:00
|
|
|
#if defined(HAVE_RL_PRE_INPUT_HOOK)
|
|
|
|
id_pre_input_hook = rb_intern("pre_input_hook");
|
|
|
|
#endif
|
2012-05-01 20:47:57 -04:00
|
|
|
#if defined(HAVE_RL_SPECIAL_PREFIXES)
|
|
|
|
id_special_prefixes = rb_intern("special_prefixes");
|
|
|
|
#endif
|
2016-10-03 04:20:07 -04:00
|
|
|
#if defined HAVE_RL_CHAR_IS_QUOTED_P
|
|
|
|
quoting_detection_proc = rb_intern(QUOTING_DETECTION_PROC);
|
|
|
|
#endif
|
2005-01-16 17:09:29 -05:00
|
|
|
|
1999-01-19 23:59:32 -05:00
|
|
|
mReadline = rb_define_module("Readline");
|
|
|
|
rb_define_module_function(mReadline, "readline",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_readline, -1);
|
2005-06-17 12:18:56 -04:00
|
|
|
rb_define_singleton_method(mReadline, "input=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_input, 1);
|
2005-06-17 12:18:56 -04:00
|
|
|
rb_define_singleton_method(mReadline, "output=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_output, 1);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completion_proc=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_completion_proc, 1);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completion_proc",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_completion_proc, 0);
|
2016-10-03 04:20:07 -04:00
|
|
|
rb_define_singleton_method(mReadline, "quoting_detection_proc=",
|
|
|
|
readline_s_set_quoting_detection_proc, 1);
|
|
|
|
rb_define_singleton_method(mReadline, "quoting_detection_proc",
|
|
|
|
readline_s_get_quoting_detection_proc, 0);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completion_case_fold=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_completion_case_fold, 1);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completion_case_fold",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_completion_case_fold, 0);
|
2009-07-10 08:13:18 -04:00
|
|
|
rb_define_singleton_method(mReadline, "line_buffer",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_line_buffer, 0);
|
2009-07-10 08:13:18 -04:00
|
|
|
rb_define_singleton_method(mReadline, "point",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_point, 0);
|
2013-08-06 08:52:22 -04:00
|
|
|
rb_define_singleton_method(mReadline, "point=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_point, 1);
|
2009-02-03 07:21:08 -05:00
|
|
|
rb_define_singleton_method(mReadline, "set_screen_size",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_screen_size, 2);
|
2009-02-03 07:21:08 -05:00
|
|
|
rb_define_singleton_method(mReadline, "get_screen_size",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_screen_size, 0);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "vi_editing_mode",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_vi_editing_mode, 0);
|
2008-08-11 04:31:45 -04:00
|
|
|
rb_define_singleton_method(mReadline, "vi_editing_mode?",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_vi_editing_mode_p, 0);
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_singleton_method(mReadline, "emacs_editing_mode",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_emacs_editing_mode, 0);
|
2008-08-11 04:31:45 -04:00
|
|
|
rb_define_singleton_method(mReadline, "emacs_editing_mode?",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_emacs_editing_mode_p, 0);
|
2001-06-19 05:21:38 -04:00
|
|
|
rb_define_singleton_method(mReadline, "completion_append_character=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_completion_append_character, 1);
|
2001-06-19 05:21:38 -04:00
|
|
|
rb_define_singleton_method(mReadline, "completion_append_character",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_completion_append_character, 0);
|
2018-09-02 19:27:08 -04:00
|
|
|
rb_define_singleton_method(mReadline, "completion_quote_character",
|
|
|
|
readline_s_get_completion_quote_character, 0);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "basic_word_break_characters=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_basic_word_break_characters, 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "basic_word_break_characters",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_basic_word_break_characters, 0);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completer_word_break_characters=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_completer_word_break_characters, 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completer_word_break_characters",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_completer_word_break_characters, 0);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "basic_quote_characters=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_basic_quote_characters, 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "basic_quote_characters",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_basic_quote_characters, 0);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completer_quote_characters=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_completer_quote_characters, 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "completer_quote_characters",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_completer_quote_characters, 0);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "filename_quote_characters=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_filename_quote_characters, 1);
|
2001-12-19 03:02:55 -05:00
|
|
|
rb_define_singleton_method(mReadline, "filename_quote_characters",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_filename_quote_characters, 0);
|
2009-07-10 09:03:40 -04:00
|
|
|
rb_define_singleton_method(mReadline, "refresh_line",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_refresh_line, 0);
|
2012-05-01 09:21:55 -04:00
|
|
|
rb_define_singleton_method(mReadline, "pre_input_hook=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_pre_input_hook, 1);
|
2012-05-01 09:21:55 -04:00
|
|
|
rb_define_singleton_method(mReadline, "pre_input_hook",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_pre_input_hook, 0);
|
2012-05-01 09:21:55 -04:00
|
|
|
rb_define_singleton_method(mReadline, "insert_text",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_insert_text, 1);
|
2013-07-21 20:37:10 -04:00
|
|
|
rb_define_singleton_method(mReadline, "delete_text",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_delete_text, -1);
|
2012-05-01 09:21:55 -04:00
|
|
|
rb_define_singleton_method(mReadline, "redisplay",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_redisplay, 0);
|
2012-05-01 20:47:57 -04:00
|
|
|
rb_define_singleton_method(mReadline, "special_prefixes=",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_set_special_prefixes, 1);
|
2012-05-01 20:47:57 -04:00
|
|
|
rb_define_singleton_method(mReadline, "special_prefixes",
|
2013-08-06 09:07:25 -04:00
|
|
|
readline_s_get_special_prefixes, 0);
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2011-01-09 00:54:33 -05:00
|
|
|
#if USE_INSERT_IGNORE_ESCAPE
|
2018-02-16 03:39:48 -05:00
|
|
|
id_orig_prompt = rb_intern("orig_prompt");
|
|
|
|
id_last_prompt = rb_intern("last_prompt");
|
2011-01-09 00:54:33 -05:00
|
|
|
#endif
|
|
|
|
|
2002-08-06 02:20:07 -04:00
|
|
|
history = rb_obj_alloc(rb_cObject);
|
|
|
|
rb_extend_object(history, rb_mEnumerable);
|
|
|
|
rb_define_singleton_method(history,"to_s", hist_to_s, 0);
|
|
|
|
rb_define_singleton_method(history,"[]", hist_get, 1);
|
|
|
|
rb_define_singleton_method(history,"[]=", hist_set, 2);
|
|
|
|
rb_define_singleton_method(history,"<<", hist_push, 1);
|
|
|
|
rb_define_singleton_method(history,"push", hist_push_method, -1);
|
|
|
|
rb_define_singleton_method(history,"pop", hist_pop, 0);
|
|
|
|
rb_define_singleton_method(history,"shift", hist_shift, 0);
|
|
|
|
rb_define_singleton_method(history,"each", hist_each, 0);
|
|
|
|
rb_define_singleton_method(history,"length", hist_length, 0);
|
|
|
|
rb_define_singleton_method(history,"size", hist_length, 0);
|
|
|
|
rb_define_singleton_method(history,"empty?", hist_empty_p, 0);
|
|
|
|
rb_define_singleton_method(history,"delete_at", hist_delete_at, 1);
|
2008-08-01 11:04:37 -04:00
|
|
|
rb_define_singleton_method(history,"clear", hist_clear, 0);
|
2008-08-07 11:06:36 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The history buffer. It extends Enumerable module, so it behaves
|
|
|
|
* just like an array.
|
|
|
|
* For example, gets the fifth content that the user input by
|
|
|
|
* HISTORY[4].
|
|
|
|
*/
|
2002-08-06 02:20:07 -04:00
|
|
|
rb_define_const(mReadline, "HISTORY", history);
|
1999-01-19 23:59:32 -05:00
|
|
|
|
|
|
|
fcomp = rb_obj_alloc(rb_cObject);
|
|
|
|
rb_define_singleton_method(fcomp, "call",
|
2013-08-06 09:07:25 -04:00
|
|
|
filename_completion_proc_call, 1);
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* The Object with the call method that is a completion for filename.
|
|
|
|
* This is sets by Readline.completion_proc= method.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_const(mReadline, "FILENAME_COMPLETION_PROC", fcomp);
|
|
|
|
|
|
|
|
ucomp = rb_obj_alloc(rb_cObject);
|
|
|
|
rb_define_singleton_method(ucomp, "call",
|
2013-08-06 09:07:25 -04:00
|
|
|
username_completion_proc_call, 1);
|
2008-08-07 11:06:36 -04:00
|
|
|
/*
|
|
|
|
* The Object with the call method that is a completion for usernames.
|
|
|
|
* This is sets by Readline.completion_proc= method.
|
|
|
|
*/
|
1999-01-19 23:59:32 -05:00
|
|
|
rb_define_const(mReadline, "USERNAME_COMPLETION_PROC", ucomp);
|
2008-08-01 11:04:37 -04:00
|
|
|
history_get_offset_func = history_get_offset_history_base;
|
2011-11-03 12:23:58 -04:00
|
|
|
history_replace_offset_func = history_get_offset_0;
|
2005-05-19 10:36:20 -04:00
|
|
|
#if defined HAVE_RL_LIBRARY_VERSION
|
2008-10-22 01:55:22 -04:00
|
|
|
version = rb_str_new_cstr(rl_library_version);
|
2008-09-22 13:07:22 -04:00
|
|
|
#if defined HAVE_CLEAR_HISTORY || defined HAVE_REMOVE_HISTORY
|
2010-04-22 04:04:13 -04:00
|
|
|
if (strncmp(rl_library_version, EDIT_LINE_LIBRARY_VERSION,
|
2013-08-06 09:07:25 -04:00
|
|
|
strlen(EDIT_LINE_LIBRARY_VERSION)) == 0) {
|
|
|
|
add_history("1");
|
|
|
|
if (history_get(history_get_offset_func(0)) == NULL) {
|
|
|
|
history_get_offset_func = history_get_offset_0;
|
|
|
|
}
|
2011-11-03 12:23:58 -04:00
|
|
|
#ifdef HAVE_REPLACE_HISTORY_ENTRY
|
2013-08-06 09:07:25 -04:00
|
|
|
if (replace_history_entry(0, "a", NULL) == NULL) {
|
|
|
|
history_replace_offset_func = history_get_offset_history_base;
|
|
|
|
}
|
2011-11-03 12:23:58 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_CLEAR_HISTORY
|
2013-08-06 09:07:25 -04:00
|
|
|
clear_history();
|
2008-09-22 13:07:22 -04:00
|
|
|
#else
|
2013-08-06 09:07:25 -04:00
|
|
|
{
|
|
|
|
HIST_ENTRY *entry = remove_history(0);
|
|
|
|
if (entry) {
|
|
|
|
free((char *)entry->line);
|
|
|
|
free(entry);
|
|
|
|
}
|
|
|
|
}
|
2008-09-22 13:07:22 -04:00
|
|
|
#endif
|
2008-08-01 11:04:37 -04:00
|
|
|
}
|
|
|
|
#endif
|
2001-09-06 01:14:06 -04:00
|
|
|
#else
|
2008-10-22 01:55:22 -04:00
|
|
|
version = rb_str_new_cstr("2.0 or prior version");
|
2001-09-06 01:14:06 -04:00
|
|
|
#endif
|
2008-08-07 11:06:36 -04:00
|
|
|
/* Version string of GNU Readline or libedit. */
|
|
|
|
rb_define_const(mReadline, "VERSION", version);
|
1999-01-19 23:59:32 -05:00
|
|
|
|
2005-05-19 10:36:20 -04:00
|
|
|
rl_attempted_completion_function = readline_attempted_completion_function;
|
2012-05-01 09:21:55 -04:00
|
|
|
#if defined(HAVE_RL_PRE_INPUT_HOOK)
|
2017-03-06 23:46:46 -05:00
|
|
|
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
|
2012-05-01 09:21:55 -04:00
|
|
|
#endif
|
2016-10-03 04:20:07 -04:00
|
|
|
#if defined HAVE_RL_CHAR_IS_QUOTED_P
|
|
|
|
rl_char_is_quoted_p = &readline_char_is_quoted;
|
|
|
|
#endif
|
2012-08-07 07:22:04 -04:00
|
|
|
#ifdef HAVE_RL_CATCH_SIGNALS
|
|
|
|
rl_catch_signals = 0;
|
|
|
|
#endif
|
2005-05-19 10:36:20 -04:00
|
|
|
#ifdef HAVE_RL_CLEAR_SIGNALS
|
1999-01-19 23:59:32 -05:00
|
|
|
rl_clear_signals();
|
2005-05-19 10:36:20 -04:00
|
|
|
#endif
|
2010-01-12 02:48:06 -05:00
|
|
|
|
2013-08-06 08:24:40 -04:00
|
|
|
rb_gc_register_address(&readline_instream);
|
|
|
|
rb_gc_register_address(&readline_outstream);
|
1999-01-19 23:59:32 -05:00
|
|
|
}
|
2016-11-17 06:52:11 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* end:
|
|
|
|
*/
|