no212.patch
| ext/readline/readline.c (working copy) | ||
|---|---|---|
| 511 | 511 |
#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */ |
| 512 | 512 |
} |
| 513 | 513 | |
| 514 |
#ifdef HAVE_EDITLINE_READLINE_H |
|
| 515 |
#define HISTORY_BASE (history_base - 1) |
|
| 516 |
#else |
|
| 517 |
#define HISTORY_BASE (history_base) |
|
| 518 |
#endif |
|
| 519 | ||
| 514 | 520 |
static VALUE |
| 515 | 521 |
hist_to_s(self) |
| 516 | 522 |
VALUE self; |
| ... | ... | |
| 531 | 537 |
if (i < 0) {
|
| 532 | 538 |
i += history_length; |
| 533 | 539 |
} |
| 534 |
entry = history_get(history_base + i);
|
|
| 540 |
entry = history_get(HISTORY_BASE + i);
|
|
| 535 | 541 |
if (entry == NULL) {
|
| 536 | 542 |
rb_raise(rb_eIndexError, "invalid index"); |
| 537 | 543 |
} |
| ... | ... | |
| 649 | 655 | |
| 650 | 656 |
rb_secure(4); |
| 651 | 657 |
for (i = 0; i < history_length; i++) {
|
| 652 |
entry = history_get(history_base + i);
|
|
| 658 |
entry = history_get(HISTORY_BASE + i);
|
|
| 653 | 659 |
if (entry == NULL) |
| 654 | 660 |
break; |
| 655 | 661 |
rb_yield(rb_tainted_str_new2(entry->line)); |