diff options
| author | Stan Lo <stan001212@gmail.com> | 2024-02-01 16:19:03 +0000 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-02-01 16:19:07 +0000 |
| commit | f36c61d27fcdc47d4aa34e8a3b52590aac08bb69 (patch) | |
| tree | 11547196afabbf59a4038ce5a2906f1e98ae2ef8 /include/ruby/ruby.h | |
| parent | 6ad585bd68af55cbf111ea9b2b44244c8a75e1cd (diff) | |
[ruby/irb] Reset history counter even when @loaded_history_lines is
not defined
(https://github.com/ruby/irb/pull/853)
The issue (https://github.com/ruby/debug/issues/1064) is caused by a
combination of factors:
1. When user starts an IRB session without a history file, the
`@loaded_history_lines` ivar is not defined.
2. If the user then starts the `irb:rdbg` session, the history counter
is not set, because the `@loaded_history_lines` is not defined.
3. Because `irb:rdbg` saves the history before passing Ruby expression
to the debugger, it saves the history with duplicated lines. The number
grows in exponential order.
4. When the user exits the `irb:rdbg` session, the history file could be
bloated with duplicated lines.
This commit fixes the issue by resetting the history counter even when
`@loaded_history_lines` is not defined.
https://github.com/ruby/irb/commit/4afc98c258
Diffstat (limited to 'include/ruby/ruby.h')
0 files changed, 0 insertions, 0 deletions
