Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/irb/command/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class History < Base

def execute(arg)

if (match = arg&.match(/(-g|-G)\s+(?<grep>.+)\s*\n\z/))
if (match = arg&.match(/(-g|-G)\s+(?<grep>.+)\s*\z/))
grep = Regexp.new(match[:grep])
end

Expand Down
6 changes: 6 additions & 0 deletions test/irb/test_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,12 @@ def test_history_grep
puts x
...
EOF
assert_not_include(out, <<~EOF)
foo
EOF
assert_not_include(out, <<~EOF)
bar
EOF
assert_empty err
end

Expand Down
Loading