comparison main.c @ 552:dfe46cd1b81b

Cosmetics, comments.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 12 Nov 2012 19:10:01 +0200
parents 89fafb218396
children b464409fa643
comparison
equal deleted inserted replaced
551:89fafb218396 552:dfe46cd1b81b
55 *optLogPath = NULL, 55 *optLogPath = NULL,
56 *optLogExtension = ".log", 56 *optLogExtension = ".log",
57 *optSite = "NN", 57 *optSite = "NN",
58 *optNickSepStr = NULL; 58 *optNickSepStr = NULL;
59 char optNickSep; 59 char optNickSep;
60 BOOL optDaemon = FALSE; 60 BOOL optDaemon = FALSE,
61 BOOL setIgnoreMode = FALSE, 61 setIgnoreMode = FALSE,
62 optDebug = FALSE, 62 optDebug = FALSE,
63 optLogEnable = FALSE, 63 optLogEnable = FALSE,
64 optOnlyFriendPrv = FALSE; 64 optOnlyFriendPrv = FALSE;
65 65
66 qlist_t *setIgnoreList = NULL, 66 qlist_t *setIgnoreList = NULL,
1525 win->logFilename = th_strdup_printf("%sroom_%d%s", 1525 win->logFilename = th_strdup_printf("%sroom_%d%s",
1526 path != NULL ? path : "", optPort, optLogExtension); 1526 path != NULL ? path : "", optPort, optLogExtension);
1527 } 1527 }
1528 else 1528 else
1529 { 1529 {
1530 // PRV chat log
1530 size_t pos; 1531 size_t pos;
1531 char *cleaned; 1532 char *cleaned;
1532 1533
1533 if ((cleaned = th_strdup(win->id)) == NULL) 1534 if ((cleaned = th_strdup(win->id)) == NULL)
1534 return FALSE; 1535 return FALSE;
1543 path != NULL ? path : "", cleaned, optLogExtension); 1544 path != NULL ? path : "", cleaned, optLogExtension);
1544 1545
1545 th_free(cleaned); 1546 th_free(cleaned);
1546 } 1547 }
1547 1548
1549 // Try to open the file for appending
1548 if (win->logFilename == NULL) 1550 if (win->logFilename == NULL)
1549 goto error; 1551 goto error;
1550 1552
1551 if ((win->logFile = fopen(win->logFilename, "a")) == NULL) 1553 if ((win->logFile = fopen(win->logFilename, "a")) == NULL)
1552 { 1554 {