From ff599aea7cb810ca5284c10184f435101e4b9349 Mon Sep 17 00:00:00 2001 From: tomoya ishida Date: Thu, 18 Apr 2024 23:46:36 +0900 Subject: [ruby/irb] Fix % escape in prompt format (https://github.com/ruby/irb/pull/927) https://github.com/ruby/irb/commit/08eee25d28 --- lib/irb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/irb.rb b/lib/irb.rb index f7019ab0ea..d6afd6e510 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -1457,7 +1457,7 @@ module IRB end def format_prompt(format, ltype, indent, line_no) # :nodoc: - format.gsub(/%([0-9]+)?([a-zA-Z])/) do + format.gsub(/%([0-9]+)?([a-zA-Z%])/) do case $2 when "N" @context.irb_name @@ -1490,7 +1490,7 @@ module IRB line_no.to_s end when "%" - "%" + "%" unless $1 end end end -- cgit v1.2.3