From e32ce0cfdccf5240ae29ef06a13078ae37ee521a Mon Sep 17 00:00:00 2001 From: james <> Date: Wed, 13 Feb 2008 16:57:29 +0000 Subject: *** empty log message *** --- src/history.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/history.c') diff --git a/src/history.c b/src/history.c index b8637aa..24d3692 100644 --- a/src/history.c +++ b/src/history.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.3 2008/02/13 16:57:29 james + * *** empty log message *** + * * Revision 1.2 2008/02/12 22:36:46 james * *** empty log message *** * @@ -49,13 +52,28 @@ history_free (History * h) void history_add (History * h, CRT_CA * c) { + History_ent *e; if (!h) return; - memcpy (h->lines[h->wptr].line, c, sizeof (CRT_CA) * CRT_COLS); - h->wptr++; + e = &h->lines[h->wptr]; + HISTORY_INC (h, h->wptr); + + memcpy (e->line, c, sizeof (CRT_CA) * CRT_COLS); + time (&e->t); + e->valid = 1; + +#if 0 + { + int i = CRT_COLS; + while (i--) + { + fputc (c->chr, stderr); + c++; + } + fputc ('\n', stderr); + } +#endif - if (h->wptr == h->nlines) - h->wptr = 0; } -- cgit v1.2.3