• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Révision8668 (tree)
l'heure2020-04-01 23:31:14
Auteurzmatsuo

Message de Log

exec を Unicode 対応にした

Change Summary

Modification

--- branches/unicode_macro_2/teraterm/ttpmacro/ttl.cpp (revision 8667)
+++ branches/unicode_macro_2/teraterm/ttpmacro/ttl.cpp (revision 8668)
@@ -67,6 +67,7 @@
6767 #include "win16api.h"
6868 #include "ttl_gui.h"
6969 #include "codeconv.h"
70+#include "layer_for_unicode.h"
7071
7172 #define TTERMCOMMAND "TTERMPRO /D="
7273 #define CYGTERMCOMMAND "cyglaunch -o /D="
@@ -1017,7 +1018,7 @@
10171018 int wait = 0;
10181019 DWORD ret;
10191020 WORD Err;
1020- STARTUPINFO sui;
1021+ STARTUPINFOW sui;
10211022 PROCESS_INFORMATION pi;
10221023 BOOL bRet;
10231024
@@ -1060,17 +1061,18 @@
10601061
10611062 if (Err!=0) return Err;
10621063
1063- memset(&sui, 0, sizeof(STARTUPINFO));
1064+ memset(&sui, 0, sizeof(sui));
10641065 sui.cb = sizeof(STARTUPINFO);
10651066 sui.wShowWindow = mode;
10661067 sui.dwFlags = STARTF_USESHOWWINDOW;
1067- tc StrT = tc::fromUtf8(Str);
1068- tc CurDirT = tc::fromUtf8(CurDir);
1069- LPTSTR StrT_NC = (TCHAR *)(const TCHAR *)StrT;
1070- if (CurDir[0] == 0)
1071- bRet = CreateProcess(NULL, StrT_NC, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &sui, &pi);
1072- else
1073- bRet = CreateProcess(NULL, StrT_NC, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, CurDirT, &sui, &pi);
1068+ wc StrW = wc::fromUtf8(Str);
1069+ wc CurDirW = wc::fromUtf8(CurDir);
1070+ const wchar_t *pStrW = StrW;
1071+ const wchar_t *pCurdirW = NULL;
1072+ if (CurDir[0] != 0) {
1073+ pCurdirW = CurDirW;
1074+ }
1075+ bRet = _CreateProcessW(NULL, (LPWSTR)pStrW, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, pCurdirW, &sui, &pi);
10741076 if (bRet == FALSE) {
10751077 // 実行できなかった場合、resultに-1を返す
10761078 SetResult(-1);
Afficher sur ancien navigateur de dépôt.