Project

General

Profile

Bug #212 » no212.patch

history_base - 1 with libedit - kouji (Kouji Takao), 07/13/2008 09:09 PM

View differences:

ext/readline/readline.c (working copy)
#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */
}
#ifdef HAVE_EDITLINE_READLINE_H
#define HISTORY_BASE (history_base - 1)
#else
#define HISTORY_BASE (history_base)
#endif
static VALUE
hist_to_s(self)
VALUE self;
......
if (i < 0) {
i += history_length;
}
entry = history_get(history_base + i);
entry = history_get(HISTORY_BASE + i);
if (entry == NULL) {
rb_raise(rb_eIndexError, "invalid index");
}
......
rb_secure(4);
for (i = 0; i < history_length; i++) {
entry = history_get(history_base + i);
entry = history_get(HISTORY_BASE + i);
if (entry == NULL)
break;
rb_yield(rb_tainted_str_new2(entry->line));
(1-1/3)