summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkraxel <kraxel>2007-08-20 11:23:18 +0000
committerkraxel <kraxel>2007-08-20 11:23:18 +0000
commitbd5a7f26f806ebee529c00614f19b8e891f8d528 (patch)
tree89943b059ec3f8fb534e9007fa5325b7710d715f
parente1920a6861171bde2aafa3e71a0cca39452aca11 (diff)
downloadamtterm-bd5a7f26f806ebee529c00614f19b8e891f8d528.tar.gz
timestamps for hosts history
-rw-r--r--gamt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gamt.c b/gamt.c
index 4ffa5b5..64d8922 100644
--- a/gamt.c
+++ b/gamt.c
@@ -211,6 +211,7 @@ static void state_gtk(void *cb_data, enum redir_state old, enum redir_state new)
{
struct gamt_window *gamt = cb_data;
unsigned char buf[128];
+ int last;
switch (new) {
case REDIR_ERROR:
@@ -222,9 +223,10 @@ static void state_gtk(void *cb_data, enum redir_state old, enum redir_state new)
}
break;
case REDIR_RUN_SOL:
- cfg_set_int("config", "hosts", gamt->redir.host,
- cfg_get_int("config", "hosts", gamt->redir.host, 0) +1);
- gamt_rebuild_hosts(gamt);
+ last = cfg_get_int("config", "hosts", gamt->redir.host, 0);
+ cfg_set_int("config", "hosts", gamt->redir.host, time(NULL));
+ if (!last)
+ gamt_rebuild_hosts(gamt);
/* fall through */
default:
snprintf(buf, sizeof(buf), "%s: %s", gamt->redir.host,