diff options
author | 0xAB <0xAB@protonmail.com> | 2017-08-28 05:16:28 +0100 |
---|---|---|
committer | 0xAB <0xAB@protonmail.com> | 2017-08-28 05:16:28 +0100 |
commit | e6b58587002a8174307a6069aa6d64ec02554267 (patch) | |
tree | d2cc39e40d0ea67564e21bfae92a526f56687e0e | |
parent | 5f83fe196074b9b81b37133ae575cee5ff131a0a (diff) | |
download | pry-e6b58587002a8174307a6069aa6d64ec02554267.tar.gz |
0 isnt valid as response
-rw-r--r-- | lib/pry/commands/change_prompt.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/commands/change_prompt.rb b/lib/pry/commands/change_prompt.rb index 36382d09..1fff0451 100644 --- a/lib/pry/commands/change_prompt.rb +++ b/lib/pry/commands/change_prompt.rb @@ -29,7 +29,7 @@ class Pry::Command::ChangePrompt < Pry::ClassCommand end output.write "Choice: " reply = _pry_.input.respond_to?(:gets) ? _pry_.input.gets : _pry_.input.readline - if reply =~ /^\d+$/ and reply.to_i <= prompts.size + if reply =~ /^[1-9]+$/ and reply.to_i <= prompts.size _pry_.prompt = prompts[reply.to_i-1].proc_array else multiple_choice(prompts) |