Skip to content

Commit 3210c53

Browse files
author
kernelsmith
committed
undo vestiges of attempt to add tab_complete nesting
return code to original state before I started editing
1 parent f7195fb commit 3210c53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/rex/ui/text/dispatcher_shell.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def initialize(prompt, prompt_char = '>', histfile = nil, framework = nil)
273273
# a design problem in the Readline module and depends on the
274274
# Readline.basic_word_break_characters variable being set to \x00
275275
#
276-
def tab_complete(str, previous_words = [])
276+
def tab_complete(str)
277277
# Check trailing whitespace so we can tell 'x' from 'x '
278278
str_match = str.match(/\s+$/)
279279
str_trail = (str_match.nil?) ? '' : str_match[0]
@@ -288,13 +288,13 @@ def tab_complete(str, previous_words = [])
288288
self.tab_words = str_words
289289

290290
# Pop the last word and pass it to the real method
291-
tab_complete_stub(self.tab_words.pop, previous_words)
291+
tab_complete_stub(self.tab_words.pop)
292292
end
293293

294294
# Performs tab completion of a command, if supported
295295
# Current words can be found in self.tab_words
296296
#
297-
def tab_complete_stub(str, previous_words = [])
297+
def tab_complete_stub(str)
298298
items = []
299299

300300
return nil if not str
@@ -339,9 +339,9 @@ def tab_complete_stub(str, previous_words = [])
339339
# Match based on the partial word
340340
items.find_all { |e|
341341
e =~ /^#{str}/
342-
# Prepend the rest of the command, and all previous_words (or it all gets replaced!)
342+
# Prepend the rest of the command (or it all gets replaced!)
343343
}.map { |e|
344-
(previous_words + tab_words).push(e).join(' ')
344+
tab_words.dup.push(e).join(' ')
345345
}
346346
end
347347

0 commit comments

Comments
 (0)