From efafb793c43ff307dcb474cf08d5afee7d9dea02 Mon Sep 17 00:00:00 2001 From: James Lee Date: Wed, 29 Dec 2010 21:10:14 +0000 Subject: [PATCH] only add a / if one wasn't there before; update comments/documentation to reflect the current reality now that #968 and #664 are fixed git-svn-id: file:///home/svn/framework3/trunk@11452 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/ui/console/command_dispatcher.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/msf/ui/console/command_dispatcher.rb b/lib/msf/ui/console/command_dispatcher.rb index 14d018adbb..d23cdffc39 100644 --- a/lib/msf/ui/console/command_dispatcher.rb +++ b/lib/msf/ui/console/command_dispatcher.rb @@ -102,15 +102,14 @@ module CommandDispatcher # # Provide a generic tab completion for file names. # - # This currently works with the system readline (i.e. when msfconsole was - # invoked with -i) for everything but doesn't do more than files the - # current directory in the bundled rbreadline. In rbreadline anything with - # a / will fail to complete. + # If the only completion is a directory, this descends into that directory + # and continues completions with filenames contained within. # def tab_complete_filenames(str, words) matches = ::Readline::FILENAME_COMPLETION_PROC.call(str) if matches and matches.length == 1 and File.directory?(matches[0]) - dir = (matches[0] + File::SEPARATOR) + dir = matches[0] + dir += File::SEPARATOR if dir[-1,1] != File::SEPARATOR matches = ::Readline::FILENAME_COMPLETION_PROC.call(dir) end matches @@ -120,7 +119,7 @@ module CommandDispatcher # The driver that this command dispatcher is associated with. # attr_accessor :driver - + end ###