Land #10424, history deduplication on save

4.x
William Vu 2018-08-07 11:26:23 -05:00 committed by Metasploit
parent 6b6191a534
commit 807baacc2c
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 3 additions and 4 deletions

View File

@ -208,10 +208,9 @@ module Shell
ret = run_single(line)
# don't bother saving lines that couldn't be found as a
# command, create the file if it doesn't exist
if ret and self.histfile
File.open(self.histfile, "a+") { |f|
f.puts(line)
}
if ret && self.histfile && line != @last_line
File.open(self.histfile, "a+") { |f| f.puts(line) }
@last_line = line
end
self.stop_count = 0
end