Merge pull request #115 from doegox/master

cmds history: don't push to history if last command is replayed
This commit is contained in:
Iceman 2019-03-05 21:21:01 +01:00 committed by GitHub
commit a8b3ccdce0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}