svnno****@sourc*****
svnno****@sourc*****
2017年 6月 9日 (金) 23:32:31 JST
Revision: 6791 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6791 Author: doda Date: 2017-06-09 23:32:31 +0900 (Fri, 09 Jun 2017) Log Message: ----------- TTX をフルパスで LoadLibrary() するようにした。 Modified Paths: -------------- trunk/teraterm/teraterm/ttplug.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/ttplug.c =================================================================== --- trunk/teraterm/teraterm/ttplug.c 2017-06-09 14:32:28 UTC (rev 6790) +++ trunk/teraterm/teraterm/ttplug.c 2017-06-09 14:32:31 UTC (rev 6791) @@ -83,27 +83,17 @@ //if (getenv("TERATERM_EXTENSIONS") != NULL) { if (1) { char buf[1024]; - int index; struct _finddata_t searchData; long searchHandle; - if (GetModuleFileName(hInst, buf, sizeof(buf)) == 0) { - return; - } - for (index = strlen(buf) - 1; - index >= 0 && buf[index] != '\\' && buf[index] != ':' && buf[index] != '/'; - index--) { - } - index++; - strncpy_s(buf + index, sizeof(buf) - index, "TTX*.DLL", _TRUNCATE); + _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\TTX*.DLL", ts->HomeDir); - searchHandle = _findfirst(buf,&searchData); + searchHandle = _findfirst(buf, &searchData); if (searchHandle != -1L) { - loadExtension(&extensionList, searchData.name); - - while (_findnext(searchHandle, &searchData)==0) { - loadExtension(&extensionList, searchData.name); - } + do { + _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\%s", ts->HomeDir, searchData.name); + loadExtension(&extensionList, buf); + } while (_findnext(searchHandle, &searchData)==0); _findclose(searchHandle); }