Fix lurking bugs in the shell's prompt_yesno

GSoC/Meterpreter_Web_Console
Adam Cammack 2018-08-16 09:05:22 -05:00
parent c045f70e80
commit 4375a3fbfb
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 2 additions and 2 deletions

View File

@ -434,9 +434,9 @@ protected
#
def prompt_yesno(query)
p = "#{query} [y/N]"
old_p = [self.prompt.sub(/#{self.prompt_char} $/, ''), self.prompt_char]
old_p = [self.prompt.sub(/#{Regexp.escape(self.prompt_char)} $/, ''), self.prompt_char]
update_prompt p, ' ', true
/^y/ === get_input_line
/^y/i === get_input_line
ensure
update_prompt *old_p, true
end