From 4dfcb727afefecc42cb708b73b92d3f2f037cb8b Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 5 Mar 2019 21:14:30 +0100 Subject: [PATCH] cmds history: don't push to history if last command is replayed --- client/proxmark3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/proxmark3.c b/client/proxmark3.c index 246da350b..072fec427 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -167,7 +167,9 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) { if (cmd[0] != 0x00) { int ret = CommandReceived(cmd); - add_history(cmd); + HIST_ENTRY * entry = history_get(history_length); + if ((!entry) || (strcmp(entry->line, cmd) != 0)) + add_history(cmd); // exit or quit if (ret == 99) @@ -384,4 +386,4 @@ int main(int argc, char* argv[]) { } exit(0); -} \ No newline at end of file +}