Revision: 9857 https://osdn.net/projects/ttssh2/scm/svn/commits/9857 Author: zmatsuo Date: 2022-04-12 22:21:21 +0900 (Tue, 12 Apr 2022) Log Message: ----------- ファイル名長制限を減らした - MAX_PATH 使用部分を減らした Modified Paths: -------------- trunk/teraterm/teraterm/filesys_log.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/filesys_log.cpp =================================================================== --- trunk/teraterm/teraterm/filesys_log.cpp 2022-04-12 13:21:09 UTC (rev 9856) +++ trunk/teraterm/teraterm/filesys_log.cpp 2022-04-12 13:21:21 UTC (rev 9857) @@ -52,6 +52,7 @@ #include "helpid.h" #include "codeconv.h" #include "asprintf.h" +#include "win32helper.h" #include "filesys_log_res.h" #include "filesys_log.h" @@ -560,9 +561,9 @@ case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: { - wchar_t filename[MAX_PATH]; - GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, filename, _countof(filename)); - work->info->filename = _wcsdup(filename); + wchar_t *filename; + hGetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, &filename); + work->info->filename = filename; work->info->append = IsDlgButtonChecked(Dialog, IDC_APPEND) == BST_CHECKED; work->info->bom = IsDlgButtonChecked(Dialog, IDC_BOM) == BST_CHECKED; work->info->code = (LogCode_t)SendDlgItemMessageA(Dialog, IDC_TEXTCODING_DROPDOWN, CB_GETCURSEL, 0, 0); @@ -579,8 +580,8 @@ case IDC_FOPT_FILENAME_BUTTON: { /* save current dir */ const wchar_t *UILanguageFile = work->pts->UILanguageFileW; - wchar_t curdir[MAXPATHLEN]; - GetCurrentDirectoryW(_countof(curdir), curdir); + wchar_t *curdir; + hGetCurrentDirectoryW(&curdir); wchar_t fname[MAX_PATH]; GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname, _countof(fname)); @@ -618,6 +619,7 @@ /* restore dir */ SetCurrentDirectoryW(curdir); + free(curdir); break; } @@ -641,9 +643,10 @@ break; case IDC_FOPT_FILENAME_EDIT: if (HIWORD(wParam) == EN_CHANGE){ - wchar_t filename[MAX_PATH]; - GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, filename, _countof(filename)); + wchar_t *filename; + hGetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, &filename); CheckLogFile(Dialog, filename, work); + free(filename); } break; case IDC_NEW_OVERWRITE: