X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b41069ff844e8d8e24da43b7f777801be1a55390..d8770b1245ff0acd81f581c5667563e0d127104a:/windlg.c diff --git a/windlg.c b/windlg.c index b7e878d6..9b2e60fb 100644 --- a/windlg.c +++ b/windlg.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "ssh.h" #include "putty.h" @@ -48,6 +49,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, switch (msg) { case WM_INITDIALOG: + { + static int tabs[4] = {78, 108}; + SendDlgItemMessage (hwnd, IDN_LIST, LB_SETTABSTOPS, 2, + (LPARAM) tabs); + } for (i=0; i= negsize) { negsize += 64; events = srealloc (events, negsize * sizeof(*events)); } - events[nevents] = smalloc(1+strlen(string)); - strcpy (events[nevents], string); - nevents++; + + time(&t); + strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S\t", localtime(&t)); + + events[nevents] = smalloc(strlen(timebuf)+strlen(string)+1); + strcpy(events[nevents], timebuf); + strcat(events[nevents], string); if (logbox) { int count; SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING, - 0, (LPARAM)string); + 0, (LPARAM)events[nevents]); count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0); SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0); } + nevents++; } void showeventlog (HWND hwnd) {