[前][次][番号順一覧][スレッド一覧]

ruby-changes:65311

From: Eamonn <ko1@a...>
Date: Sun, 21 Feb 2021 07:04:13 +0900 (JST)
Subject: [ruby-changes:65311] ac9e3b514b (master): [ruby/reline] Avoid tripping over nil prompt

https://git.ruby-lang.org/ruby.git/commit/?id=ac9e3b514b

From ac9e3b514bc98ded741006c94281fb8aee10c7ef Mon Sep 17 00:00:00 2001
From: Eamonn Webster <eamonn.webster@g...>
Date: Sun, 14 Feb 2021 19:24:03 +0000
Subject: [ruby/reline] Avoid tripping over nil prompt

https://github.com/ruby/reline/commit/d4d9d3e3d4
---
 lib/reline/line_editor.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 557b5aa..793cad7 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -124,6 +124,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L124
         @prompt_cache_time = Time.now.to_f
       end
       prompt_list.map!{ prompt } if @vi_arg or @searching_prompt
+      prompt_list = [prompt] if prompt_list.empty?
       mode_string = check_mode_string
       prompt_list = prompt_list.map{ |pr| mode_string + pr } if mode_string
       prompt = prompt_list[@line_index]
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]