Revision: 9468 https://osdn.net/projects/ttssh2/scm/svn/commits/9468 Author: zmatsuo Date: 2021-10-14 23:51:56 +0900 (Thu, 14 Oct 2021) Log Message: ----------- telnet のログをログフォルダに作成するようにした Modified Paths: -------------- trunk/teraterm/teraterm/telnet.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/telnet.c =================================================================== --- trunk/teraterm/teraterm/telnet.c 2021-10-14 14:51:47 UTC (rev 9467) +++ trunk/teraterm/teraterm/telnet.c 2021-10-14 14:51:56 UTC (rev 9468) @@ -40,6 +40,7 @@ #include <process.h> #include "telnet.h" +#include "asprintf.h" #include "tt_res.h" int TelStatus; @@ -123,10 +124,13 @@ tr.WinSize.x = ts.TerminalWidth; tr.WinSize.y = ts.TerminalHeight; - if ((ts.LogFlag & LOG_TEL) != 0) - tr.LogFile = CreateFileA("TELNET.LOG", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + if ((ts.LogFlag & LOG_TEL) != 0) { + wchar_t *full_path = NULL; + awcscats(&full_path, ts.LogDirW, L"\\", L"TELNET.LOG", NULL); + tr.LogFile = CreateFileW(full_path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - else + free(full_path); + } else tr.LogFile = 0; }