Mercurial > hg > nnchat
changeset 253:993fd8eb4271
Automated merge with file:///hg/nnchat
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 24 Apr 2011 23:35:07 +0300 |
parents | 380a12286e33 (current diff) dcf78e2c458c (diff) |
children | 269135d58acd |
files | |
diffstat | 1 files changed, 18 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/nnchat.c Thu Apr 21 04:17:12 2011 +0300 +++ b/nnchat.c Sun Apr 24 23:35:07 2011 +0300 @@ -942,13 +942,14 @@ return FALSE; } -#define VPUTCH(CH) th_vputch(&bufData, &bufSize, &bufLen, CH) +#define VPUTCH(CH) th_vputch(&bufData, &bufSize, &bufLen, CH) #define VPUTS(STR) th_vputs(&bufData, &bufSize, &bufLen, STR) char *logParseFilename(const char *fmt, int id) { - size_t bufSize = strlen(fmt) + 32, bufLen = 0; - char *bufData = NULL, tmpBuf[32]; + size_t bufSize = strlen(fmt) + TH_BUFGROW, bufLen = 0; + char *bufData = th_malloc(bufSize); + char tmpBuf[32]; const char *s = fmt; while (*s) { @@ -959,15 +960,15 @@ snprintf(tmpBuf, sizeof(tmpBuf), "%05d", id); VPUTS(tmpBuf); break; - + + case 'd': + snprintf(tmpBuf, sizeof(tmpBuf), "%d", id); + VPUTS(tmpBuf); + break; + case '%': VPUTCH('%'); break; - - default: - VPUTCH('%'); - VPUTCH(*s); - break; } s++; } else { @@ -1291,6 +1292,14 @@ if (c == '[') { c = wgetch(stdscr); switch (c) { + case 0x31: + c = wgetch(stdscr); + if (c >= 0x31 && c <= 0x39) + c = KEY_F(c - 0x30); + else + c = ERR; + break; + case 0x32: c = KEY_IC; break; case 0x33: c = KEY_DC; break;