Refactor history deduplication
We don't need to know the absolute index. We also fix the IndexError.GSoC/Meterpreter_Web_Console
parent
fce19cf5b8
commit
a0962855bd
|
@ -168,8 +168,10 @@ begin
|
|||
end
|
||||
|
||||
if add_history && line
|
||||
index = ::Readline::HISTORY.length - 1
|
||||
RbReadline.add_history(line) if not (line == ::Readline::HISTORY[index])
|
||||
# Don't add duplicate lines to history
|
||||
if ::Readline::HISTORY.empty? || line != ::Readline::HISTORY[-1]
|
||||
RbReadline.add_history(line)
|
||||
end
|
||||
end
|
||||
|
||||
line.try(:dup)
|
||||
|
|
Loading…
Reference in New Issue