[ttssh2-commit] [10743] getpassword マクロコマンドで、ユーザにパスワードを問い合わせて入力がなかった場合、パスワードを格納する変数に何もしないようにした。

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 6月 7日 (水) 01:25:37 JST


Revision: 10743
          https://osdn.net/projects/ttssh2/scm/svn/commits/10743
Author:   nmaya
Date:     2023-06-07 01:25:36 +0900 (Wed, 07 Jun 2023)
Log Message:
-----------
getpassword マクロコマンドで、ユーザにパスワードを問い合わせて入力がなかった場合、パスワードを格納する変数に何もしないようにした。

不定な値がコピーされていた。

ticket #48167
Merge from 4-stable r10742

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/10742

Ticket Links:
------------
    https://osdn.net/projects/ttssh2/tracker/detail/48167

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpmacro/ttl_gui.cpp

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2023-06-06 16:22:48 UTC (rev 10742)
+++ trunk/doc/en/html/about/history.html	2023-06-06 16:25:36 UTC (rev 10743)
@@ -80,6 +80,7 @@
       <li>Fixed the area selected with the mouse does not disappear when the text is erased with the erase escape sequences.</li>
       <li>Fixed DPI adjustment does not work correctly when VT Window is moved to different DPI monitor.</li>
       <li>MACRO: The <a href="../macro/command/setpassword.html">setpassword</a> command cause an error when password argument is a string value. Only string variable was accepted.</li>
+      <li>MACRO: The <a href="../macro/command/getpassword.html">getpassword</a> command updates password variable by undefined value when password from user is no input.</li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2023-06-06 16:22:48 UTC (rev 10742)
+++ trunk/doc/ja/html/about/history.html	2023-06-06 16:25:36 UTC (rev 10743)
@@ -78,6 +78,7 @@
       <li>\x8F\xC1\x8B\x8E\x83V\x81[\x83P\x83\x93\x83X\x82ŕ\xB6\x8E\x9A\x82\xAA\x8F\xC1\x82\xB3\x82ꂽ\x82Ƃ\xAB\x81A\x83}\x83E\x83X\x82őI\x91\xF0\x82\xB5\x82\xBD\x97̈悪\x8F\xC1\x82\xA6\x82Ȃ\xA2\x82悤\x82ɏC\x90\xB3\x82\xB5\x82\xBD</li>
       <li>VT \x83E\x83B\x83\x93\x83h\x83E\x82\xAA\x88قȂ郂\x83j\x83^\x82\xF0\x82܂\xBD\x82\xAE\x8E\x9E\x81ADPI\x92\xB2\x90\xAE\x82\xAA\x82\xA4\x82܂\xAD\x8Ds\x82\xED\x82\xEA\x82Ȃ\xA2\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD</li>
       <li><a href="../macro/command/setpassword.html">setpassword</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82ŁA\x83p\x83X\x83\x8F\x81[\x83h\x82𕶎\x9A\x97\xF1\x82œn\x82\xB7\x82\xC6 Syntax Error \x82ɂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B\x95\xB6\x8E\x9A\x97\xF1\x95ϐ\x94\x82œn\x82\xB3\x82Ȃ\xA2\x82Ǝ󂯕t\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x81B</li>
+      <li><a href="../macro/command/getpassword.html">getpassword</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82Ń\x86\x81[\x83U\x82Ƀp\x83X\x83\x8F\x81[\x83h\x82\xF0\x96₢\x8D\x87\x82킹\x82ē\xFC\x97͂\xAA\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x81A\x83p\x83X\x83\x8F\x81[\x83h\x82\xF0\x8Ai\x94[\x82\xB7\x82\xE9\x95ϐ\x94\x82̓\xE0\x97e\x82\xAA\x95s\x92\xE8\x82ɂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/ttpmacro/ttl_gui.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttl_gui.cpp	2023-06-06 16:22:48 UTC (rev 10742)
+++ trunk/teraterm/ttpmacro/ttl_gui.cpp	2023-06-06 16:25:36 UTC (rev 10743)
@@ -201,9 +201,9 @@
 	int result = 0;  /* failure */
 
 	Err = 0;
-	GetStrVal(Str,&Err);
-	GetStrVal(Str2,&Err);
-	GetStrVar(&VarId,&Err);
+	GetStrVal(Str,&Err);  // \x83t\x83@\x83C\x83\x8B\x96\xBC
+	GetStrVal(Str2,&Err);  // \x83L\x81[\x96\xBC
+	GetStrVar(&VarId,&Err);  // \x83p\x83X\x83\x8F\x81[\x83h\x8DX\x90V\x8E\x9E\x82Ƀp\x83X\x83\x8F\x81[\x83h\x82\xF0\x8Ai\x94[\x82\xB7\x82\xE9\x95ϐ\x94
 	if ((Err==0) && (GetFirstChar()!=0))
 		Err = ErrSyntax;
 	if (Err!=0) return Err;
@@ -214,7 +214,7 @@
 	GetAbsPath(Str,sizeof(Str));
 
 	GetPrivateProfileStringW(L"Password", (wc)Str2, L"",
-							  Temp, _countof(Temp), (wc)Str);
+	                         Temp, _countof(Temp), (wc)Str);
 	if (Temp[0]==0) // password not exist
 	{
 		wchar_t input_string[MaxStrLen];
@@ -235,7 +235,10 @@
 		result = 1;  /* success */
 	}
 
-	SetStrVal(VarId,Temp2);
+	if (result == 1) {
+		SetStrVal(VarId,Temp2);
+	}
+	// \x83p\x83X\x83\x8F\x81[\x83h\x93\xFC\x97͂\xAA\x82Ȃ\xA2\x82Ƃ\xAB\x82͕ϐ\x94\x82\xF0\x8DX\x90V\x82\xB5\x82Ȃ\xA2
 
 	SetResult(result);  // \x90\xAC\x8C\xF7\x89”ۂ\xF0\x90ݒ肷\x82\xE9\x81B
 	return Err;


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