~sircmpwn/imrsh

44858a35a5f1474521d4ebe3d5bd368f7fbecafe — Drew DeVault 4 years ago 823f7bf
Don't append repeated commands to history
1 files changed, 3 insertions(+), 0 deletions(-)

M src/history.c
M src/history.c => src/history.c +3 -0
@@ 119,6 119,9 @@ imrsh_history_finish(struct imrsh_history *history)
void
imrsh_history_append(struct imrsh_history *history, const char *cmd)
{
	if (history->tail && strcmp(history->tail->cmd, cmd) == 0) {
		return;
	}
	struct imrsh_history_entry *next =
		calloc(1, sizeof(struct imrsh_history_entry));
	next->cmd = strdup(cmd);