[Ttssh2-commit] [8592] ttssh で認証失敗後の認証ダイアログの文字化けを修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 3月 12日 (木) 22:52:24 JST


Revision: 8592
          https://osdn.net/projects/ttssh2/scm/svn/commits/8592
Author:   zmatsuo
Date:     2020-03-12 22:52:24 +0900 (Thu, 12 Mar 2020)
Log Message:
-----------
ttssh で認証失敗後の認証ダイアログの文字化けを修正

- UTIL_get_lang_msgW() を ttxssh/util.c に移動

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/auth.c
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/util.c
    trunk/ttssh2/ttxssh/util.h

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/auth.c
===================================================================
--- trunk/ttssh2/ttxssh/auth.c	2020-03-12 13:52:07 UTC (rev 8591)
+++ trunk/ttssh2/ttxssh/auth.c	2020-03-12 13:52:24 UTC (rev 8592)
@@ -278,10 +278,11 @@
 	// \x94F\x8F؎\xB8\x94s\x8C\xE3\x82̓\x89\x83x\x83\x8B\x82\xF0\x8F\x91\x82\xAB\x8A\xB7\x82\xA6
 	if (pvar->auth_state.failed_method != SSH_AUTH_NONE) {
 		/* must be retrying a failed attempt */
-		UTIL_get_lang_msg("DLG_AUTH_BANNER2_FAILED", pvar, "Authentication failed. Please retry.");
-		SetDlgItemText(dlg, IDC_SSHAUTHBANNER2, pvar->ts->UIMsg);
-		UTIL_get_lang_msg("DLG_AUTH_TITLE_FAILED", pvar, "Retrying SSH Authentication");
-		SetWindowText(dlg, pvar->ts->UIMsg);
+		wchar_t uimsg[MAX_UIMSG];
+		UTIL_get_lang_msgW("DLG_AUTH_BANNER2_FAILED", pvar, L"Authentication failed. Please retry.", uimsg);
+		_SetDlgItemTextW(dlg, IDC_SSHAUTHBANNER2, uimsg);
+		UTIL_get_lang_msgW("DLG_AUTH_TITLE_FAILED", pvar, L"Retrying SSH Authentication", uimsg);
+		_SetWindowTextW(dlg, uimsg);
 		default_method = pvar->auth_state.failed_method;
 	}
 

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2020-03-12 13:52:07 UTC (rev 8591)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2020-03-12 13:52:24 UTC (rev 8592)
@@ -2542,12 +2542,6 @@
 	return FALSE;
 }
 
-void UTIL_get_lang_msgW(const char *key, wchar_t *UIMsg, const wchar_t *def)
-{
-	const char *UILanguageFile = pvar->ts->UILanguageFile;
-	GetI18nStrW("TTSSH", key, UIMsg, MAX_UIMSG, def, UILanguageFile);
-}
-
 static wchar_t *get_cipher_nameW(int cipher)
 {
 	typedef struct {
@@ -2587,8 +2581,8 @@
 
 	if (cipher == SSH_CIPHER_NONE) {
 		wchar_t uimsg[MAX_UIMSG];
-		UTIL_get_lang_msgW("DLG_SSHSETUP_CIPHER_BORDER", uimsg,
-						   L"<ciphers below this line are disabled>");
+		UTIL_get_lang_msgW("DLG_SSHSETUP_CIPHER_BORDER", pvar,
+						   L"<ciphers below this line are disabled>", uimsg);
 		return _wcsdup(uimsg);
 	}
 	for (i = 0; i < _countof(list); p++,i++) {
@@ -2709,8 +2703,8 @@
 		int index = pvar->settings.KexOrder[i] - '0';
 
 		if (index == 0)	{
-			UTIL_get_lang_msgW("DLG_SSHSETUP_KEX_BORDER", uimsg,
-							   L"<KEXs below this line are disabled>");
+			UTIL_get_lang_msgW("DLG_SSHSETUP_KEX_BORDER", pvar,
+							   L"<KEXs below this line are disabled>", uimsg);
 			_SendMessageW(kexControl, LB_ADDSTRING, 0, (LPARAM)uimsg);
 		} else {
 			const char *name = get_kex_algorithm_name(index);
@@ -2728,8 +2722,8 @@
 		int index = pvar->settings.HostKeyOrder[i] - '0';
 
 		if (index == 0)	{
-			UTIL_get_lang_msgW("DLG_SSHSETUP_HOST_KEY_BORDER", uimsg,
-							   L"<Host Keys below this line are disabled>");
+			UTIL_get_lang_msgW("DLG_SSHSETUP_HOST_KEY_BORDER", pvar,
+							   L"<Host Keys below this line are disabled>", uimsg);
 			_SendMessageW(hostkeyControl, LB_ADDSTRING, 0, (LPARAM)uimsg);
 		} else {
 			const char *name = get_ssh_keytype_name(index);
@@ -2747,8 +2741,8 @@
 		int index = pvar->settings.MacOrder[i] - '0';
 
 		if (index == 0)	{
-			UTIL_get_lang_msgW("DLG_SSHSETUP_MAC_BORDER", uimsg,
-							   L"<MACs below this line are disabled>");
+			UTIL_get_lang_msgW("DLG_SSHSETUP_MAC_BORDER", pvar,
+							   L"<MACs below this line are disabled>", uimsg);
 			_SendMessageW(macControl, LB_ADDSTRING, 0, (LPARAM)uimsg);
 		} else {
 			const char *name = get_ssh2_mac_name_by_id(index);
@@ -2766,8 +2760,8 @@
 		int index = pvar->settings.CompOrder[i] - '0';
 
 		if (index == 0)	{
-			UTIL_get_lang_msgW("DLG_SSHSETUP_COMP_BORDER", uimsg,
-							   L"<Compression methods below this line are disabled>");
+			UTIL_get_lang_msgW("DLG_SSHSETUP_COMP_BORDER", pvar,
+							   L"<Compression methods below this line are disabled>", uimsg);
 			_SendMessageW(compControl, LB_ADDSTRING, 0, (LPARAM)uimsg);
 		} else {
 			const char *name = get_ssh2_comp_name(index);
@@ -2829,7 +2823,7 @@
 
 	// hostkey rotation(OpenSSH 6.8)
 	for (i = 0; i < SSH_UPDATE_HOSTKEYS_MAX; i++) {
-		UTIL_get_lang_msgW(rotationItemKey[i], uimsg, rotationItem[i]);
+		UTIL_get_lang_msgW(rotationItemKey[i], pvar, rotationItem[i], uimsg);
 		_SendMessageW(hostkeyRotationControlList, CB_INSERTSTRING, i, (LPARAM)uimsg);
 	}
 	ch = pvar->settings.UpdateHostkeys;

Modified: trunk/ttssh2/ttxssh/util.c
===================================================================
--- trunk/ttssh2/ttxssh/util.c	2020-03-12 13:52:07 UTC (rev 8591)
+++ trunk/ttssh2/ttxssh/util.c	2020-03-12 13:52:24 UTC (rev 8592)
@@ -326,6 +326,12 @@
 	GetI18nStrU8("TTSSH", key, pvar->ts->UIMsg, MAX_UIMSG, def, UILanguageFile);
 }
 
+void UTIL_get_lang_msgW(const char *key, PTInstVar pvar, const wchar_t *def, wchar_t *UIMsg)
+{
+	const char *UILanguageFile = pvar->ts->UILanguageFile;
+	GetI18nStrW("TTSSH", key, UIMsg, MAX_UIMSG, def, UILanguageFile);
+}
+
 /*
  *	\x93\x99\x95\x9D\x83t\x83H\x83\x93\x83g\x82\xF0\x8E擾
  *	@retval		\x83t\x83H\x83\x93\x83g\x83n\x83\x93\x83h\x83\x8B

Modified: trunk/ttssh2/ttxssh/util.h
===================================================================
--- trunk/ttssh2/ttxssh/util.h	2020-03-12 13:52:07 UTC (rev 8591)
+++ trunk/ttssh2/ttxssh/util.h	2020-03-12 13:52:24 UTC (rev 8592)
@@ -85,6 +85,7 @@
 BOOL UTIL_is_sock_deeply_buffered(UTILSockWriteBuf *buf);
 
 void UTIL_get_lang_msg(const char *key, PTInstVar pvar, const char *def);
+void UTIL_get_lang_msgW(const char *key, PTInstVar pvar, const wchar_t *def, wchar_t *UIMsg);
 void UTIL_get_lang_msgU8(const char *key, PTInstVar pvar, const char *def);
 HFONT UTIL_get_lang_fixedfont(HWND hWnd, const char *UILanguageFile);
 


Ttssh2-commit メーリングリストの案内
Back to archive index