diff options
author | ima1zumi <52617472+ima1zumi@users.noreply.github.com> | 2023-06-06 03:34:05 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-06-05 18:34:10 +0000 |
commit | 76ee4edb97da67d2ab6f289de14cd3ac334c372d (patch) | |
tree | d7c9dcd0de9594c975064406eba11e0cbb2019c5 /lib | |
parent | 135a5eb716399443da58db342de6093c91b5ad62 (diff) |
[ruby/irb] Fixed string escaping omissions
(https://github.com/ruby/irb/pull/599)
I received a `RegexpError` when I typed `::Array[`.
::Array[/Users/mi/ghq/github.com/ruby/irb/lib/irb/completion.rb:236:in `retrieve_completion_data': premature end of char-class: /^Array[/ (RegexpError)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/completion.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 84f4c4e35a..64e387d49c 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -233,7 +233,7 @@ module IRB if doc_namespace candidates.find { |i| i == receiver } else - candidates.grep(/^#{receiver}/).collect{|e| "::" + e} + candidates.grep(/^#{Regexp.quote(receiver)}/).collect{|e| "::" + e} end when /^([A-Z].*)::([^:.]*)$/ |