Land #9194, Add a check for .rb in cmd_edit

MS-2855/keylogger-mettle-extension
Jeffrey Martin 2017-11-09 21:56:50 -06:00
commit 7595c7c627
No known key found for this signature in database
GPG Key ID: 0CD9BBC2AF15F171
1 changed files with 4 additions and 2 deletions

View File

@ -94,10 +94,12 @@ module Msf
print_status("Launching #{editor} #{path}")
system(editor, path)
# XXX: This will try to reload *anything* and break on modules
if args.length > 0
# XXX: This will try to reload *any* .rb and break on modules
if args.length > 0 && path.end_with?('.rb')
print_status("Reloading #{path}")
load path
else
print_error('Only Ruby files can be reloaded')
end
else
print_error('Nothing to edit -- try using a module first.')