summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7bf1a1)
raw | patch | inline | side by side (parent: f7bf1a1)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 10 Jan 2014 15:40:58 +0000 (16:40 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 12 Jan 2014 18:16:12 +0000 (19:16 +0100) |
src/tools/sysdb/input.c | patch | blob | history |
index dcd12b033d76cbaa61836013617bccde9acb64e4..939a5146a9ef2369c39de5d7c7f217f62a2dcc96 100644 (file)
--- a/src/tools/sysdb/input.c
+++ b/src/tools/sysdb/input.c
{
char *query = sdb_command_exec(input);
+ HIST_ENTRY *current_hist;
+ const char *hist_line = NULL;
+
if (! query)
return -1;
+ current_hist = current_history();
+ if (current_hist)
+ hist_line = current_hist->line;
+
if (*query != ' ')
- add_history(query);
+ if ((! hist_line) || strcmp(hist_line, query))
+ add_history(query);
free(query);
return 0;
} /* sdb_input_exec_query */