Skip to content

Commit 11e3e1f

Browse files
committed
Handle a couple more edge cases
I don't want to go any further down the rabbit hole.
1 parent 41605c5 commit 11e3e1f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/msf/ui/console/command_dispatcher/modules.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ def cmd_use(*args)
598598
mod_name = args[0]
599599

600600
# Ensure we have a reference name and not a path
601-
if mod_name.start_with?('modules/')
602-
mod_name.sub!(/^modules\//, '')
601+
if mod_name.start_with?('modules/', '/')
602+
mod_name.sub!(/^(?:modules)?\//, '')
603603
end
604-
if mod_name.end_with?('.', '.rb')
605-
mod_name.sub!(/\.(?:rb)?$/, '')
604+
if mod_name.end_with?('.', '.r', '.rb')
605+
mod_name.sub!(/\.(?:rb?)?$/, '')
606606
end
607607

608608
begin

0 commit comments

Comments
 (0)