[Ttssh2-commit] [7913] filecopy マクロコマンドの結果が result システム変数に格納されないことがある問題を修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 5日 (月) 22:38:43 JST


Revision: 7913
          https://osdn.net/projects/ttssh2/scm/svn/commits/7913
Author:   maya
Date:     2019-08-05 22:38:43 +0900 (Mon, 05 Aug 2019)
Log Message:
-----------
filecopy マクロコマンドの結果が result システム変数に格納されないことがある問題を修正

GetAbsPath() がエラーになったときには格納されていた
ファイル名が同じのときやコピーに失敗したときには格納されていなかった

Modified Paths:
--------------
    trunk/doc/en/html/macro/command/filecopy.html
    trunk/doc/ja/html/about/history.html
    trunk/doc/ja/html/macro/command/filecopy.html
    trunk/teraterm/ttpmacro/ttl.c

-------------- next part --------------
Modified: trunk/doc/en/html/macro/command/filecopy.html
===================================================================
--- trunk/doc/en/html/macro/command/filecopy.html	2019-08-04 06:46:27 UTC (rev 7912)
+++ trunk/doc/en/html/macro/command/filecopy.html	2019-08-05 13:38:43 UTC (rev 7913)
@@ -26,7 +26,7 @@
 <p>
 Copies file <file1> to file <file2>.<br>
 If <file2> already exists, it is overwritten. <file1> and <file2> must not be same.<br>
-If the file is copy successfully, the system variable "result" is set to 0. Otherwise, "result" is set to non-zero.
+If the file is copy successfully, the system variable "result" is set to 0. Otherwise, "result" is set to non-zero. (version 4.104 or later)
 </p>
 
 <h2>Example</h2>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2019-08-04 06:46:27 UTC (rev 7912)
+++ trunk/doc/ja/html/about/history.html	2019-08-05 13:38:43 UTC (rev 7913)
@@ -45,7 +45,7 @@
       <li>UTF-8\x8E\xF3\x90M\x8E\x9E\x81A4byte\x82\xCCUTF-8\x82̃f\x83R\x81[\x83h\x82\xF0\x8C\xEB\x82\xC1\x82Ă\xA2\x82\xBD\x82̂ŏC\x90\xB3</li>
       <li>Ver 4.103 \x82\xC5 DLL \x82̌Ăяo\x82\xB5\x8BK\x96\xF1\x82\xF0\x95ς\xA6\x82\xBD\x82\xB1\x82ƂŁA\x82\xBB\x82\xEA\x88ȑO\x82ɃR\x83\x93\x83p\x83C\x83\x8B\x82\xB3\x82ꂽ\x83v\x83\x89\x83O\x83C\x83\x93\x82\xAA\x8CĂяo\x82\xB9\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
       <li>IME\x82̖\xA2\x8Am\x92蕶\x8E\x9A\x82\xF0\x95\\x8E\xA6\x82\xB5\x82Ă\xA2\x82\xE9\x8F\xF3\x91ԂŃt\x83H\x83\x93\x83g\x91I\x91\xF0\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x82\xC6IME\x82̃t\x83H\x83\x93\x83g\x82\xAA\x95ω\xBB\x82\xB7\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x81B</li>
-      <li></li>
+      <li><a href="../macro/command/filecopy.html">filecopy</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̌\x8B\x89ʂ\xAA result \x83V\x83X\x83e\x83\x80\x95ϐ\x94\x82Ɋi\x94[\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/macro/command/filecopy.html
===================================================================
--- trunk/doc/ja/html/macro/command/filecopy.html	2019-08-04 06:46:27 UTC (rev 7912)
+++ trunk/doc/ja/html/macro/command/filecopy.html	2019-08-05 13:38:43 UTC (rev 7913)
@@ -26,7 +26,7 @@
 <p>
 \x83t\x83@\x83C\x83\x8B <file1> \x82\xF0\x83R\x83s\x81[\x82\xB5\x81A\x83t\x83@\x83C\x83\x8B <file2> \x82\xF0\x8D쐬\x82\xB7\x82\xE9\x81B<br>
 <file2> \x82\xAA\x82\xB7\x82łɑ\xB6\x8D݂\xB7\x82\xE9\x8Fꍇ\x82͏㏑\x82\xAB\x82\xB3\x82\xEA\x82\xE9\x81B<file1> \x82\xC6 <file2> \x82͈Ⴄ\x96\xBC\x91O\x82łȂ\xAF\x82\xEA\x82΂Ȃ\xE7\x82Ȃ\xA2\x81B<br>
-\x83t\x83@\x83C\x83\x8B\x82̃R\x83s\x81[\x82\xAA\x90\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x81A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ, result \x82\xC9 0 \x88ȊO\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
+\x83t\x83@\x83C\x83\x8B\x82̃R\x83s\x81[\x82\xAA\x90\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x81A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ, result \x82\xC9 0 \x88ȊO\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B (\x83o\x81[\x83W\x83\x87\x83\x93 4.104 \x88ȍ~)
 </p>
 
 <h2>\x97\xE1</h2>

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2019-08-04 06:46:27 UTC (rev 7912)
+++ trunk/teraterm/ttpmacro/ttl.c	2019-08-05 13:38:43 UTC (rev 7913)
@@ -1405,6 +1405,7 @@
 {
 	WORD Err;
 	TStrVal FName1, FName2;
+	BOOL ret;
 
 	Err = 0;
 	GetStrVal(FName1,&Err);
@@ -1427,9 +1428,17 @@
 		SetResult(-2);
 		return Err;
 	}
-	if (_stricmp(FName1,FName2)==0) return Err;
+	if (_stricmp(FName1, FName2) == 0) {
+		SetResult(-3);
+		return Err;
+	}
 
-	CopyFile(FName1,FName2,FALSE);
+	ret = CopyFile(FName1, FName2, FALSE);
+	if (ret == 0) {
+		SetResult(-4);
+		return Err;
+	}
+
 	SetResult(0);
 	return Err;
 }


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