diff options
author | ima1zumi <[email protected]> | 2021-11-17 00:58:43 +0900 |
---|---|---|
committer | git <[email protected]> | 2021-11-21 13:56:26 +0900 |
commit | f5829e293583aa6ba6a1f1314ee22881d58a5f96 (patch) | |
tree | f8ec61d0bb33bc7eed7a58afc133df139e14e560 /lib/ipaddr.rb | |
parent | feda058531c0bdd5b673180accb4407dcc798c79 (diff) |
[ruby/reline] Correct padding space calculation
fix https://github.com/ruby/irb/issues/308
This bug occurred when `dialog.width - calculate_width(s, true)` was negative.
When `dialog.width` is shorter than `old_dialog.width`, it calculates how much padding it has to do. However, there are cases where `s` is longer than `dialog.width`, as in the issue. In that case, `padding_space_with_escape_sequences` will crash.
Here, `old_dialog.width` is longer than `dialog.width`, so I changed the padding width to `old_dialog.width - dialog.width`.
https://github.com/ruby/reline/commit/c581c31e0f
Diffstat (limited to 'lib/ipaddr.rb')
0 files changed, 0 insertions, 0 deletions