diff options
author | Takashi Kokubun <[email protected]> | 2021-03-20 23:48:10 -0700 |
---|---|---|
committer | git <[email protected]> | 2021-03-21 15:50:53 +0900 |
commit | 75b38f18940764f048ded4a3938407566152cbee (patch) | |
tree | 192f0bdcf796b0c4826f52068beb69a6630213c0 /lib | |
parent | d0b044a842ec03525ab839eb79864899ad81bed3 (diff) |
[ruby/irb] Fix step's argument
cols.size was calling Integer#size, which returns 8.
Fixing a bug of https://github.com/ruby/irb/pull/209
https://github.com/ruby/irb/commit/c93ae4be71
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/cmd/ls.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/cmd/ls.rb b/lib/irb/cmd/ls.rb index 07e6fbc487..87798a22d7 100644 --- a/lib/irb/cmd/ls.rb +++ b/lib/irb/cmd/ls.rb @@ -64,7 +64,7 @@ module IRB def col_widths(strs, cols:) cols.times.map do |col| - (col...strs.size).step(cols.size - 1).map do |i| + (col...strs.size).step(cols).map do |i| strs[i].length end.max end |