[Ttssh2-commit] [4630] ifdefined マクロコマンドに整数リテラルを渡すと TypInteger を返す問題を修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 9月 14日 (水) 00:56:43 JST


Revision: 4630
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4630
Author:   maya
Date:     2011-09-14 00:56:41 +0900 (Wed, 14 Sep 2011)

Log Message:
-----------
ifdefined マクロコマンドに整数リテラルを渡すと TypInteger を返す問題を修正
  GetFactor を使うと正しく判定されないので処理を切り出して実装した

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpmacro/ttmparse.c


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2011-09-13 12:38:11 UTC (rev 4629)
+++ trunk/doc/en/html/about/history.html	2011-09-13 15:56:41 UTC (rev 4630)
@@ -42,6 +42,7 @@
   <li>Bug fixes
     <ul>
       <li>XMODEM: The first packet is sent out twice by using the xmodem sending function. <br>cf. <a href="http://logmett.com/forum/viewtopic.php?f=2&t=354">why the first xmodem packet been always send out twice?</a></li>
+      <!--li><a href="../macro/command/ifdefined.html">ifdefined</a>‚ɐ®”ƒŠƒeƒ‰ƒ‹‚ð“n‚·‚Æ"®”Œ^•Ï”"‚Æ”»’è‚·‚é–â‘è‚ðC³‚µ‚½B</li-->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2011-09-13 12:38:11 UTC (rev 4629)
+++ trunk/doc/ja/html/about/history.html	2011-09-13 15:56:41 UTC (rev 4630)
@@ -42,6 +42,7 @@
   <li>ƒoƒOC³
     <ul>
       <li>XMODEM: ‘—MŽžA‰‰ñ‚̃pƒPƒbƒg‚ª2‰ñ‘—‚ç‚ê‚é–â‘è‚ðC³‚µ‚½B<br>cf. <a href="http://logmett.com/forum/viewtopic.php?f=2&t=354">why the first xmodem packet been always send out twice?</a></li>
+      <li><a href="../macro/command/ifdefined.html">ifdefined</a>‚ɐ®”ƒŠƒeƒ‰ƒ‹‚ð“n‚·‚Æ"®”Œ^•Ï”"‚Æ”»’è‚·‚é–â‘è‚ðC³‚µ‚½B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/ttpmacro/ttmparse.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.c	2011-09-13 12:38:11 UTC (rev 4629)
+++ trunk/teraterm/ttpmacro/ttmparse.c	2011-09-13 15:56:41 UTC (rev 4630)
@@ -1721,12 +1721,46 @@
 // for ifdefined (2006.9.23 maya)
 void GetVarType(LPWORD ValType, int far *Val, LPWORD Err)
 {
-	GetFactor(ValType,Val,Err);
+	TName Name;
+	WORD WId;
+	TVarId VarId;
+	int Index;
+
+	if (GetIdentifier(Name)) {
+		if (CheckReservedWord(Name,&WId)) {
+			*ValType = TypUnknown;
+		}
+		else {
+			CheckVar(Name, ValType, &VarId);
+			switch (*ValType) {
+				case TypIntArray:
+					if (GetIndex(&Index, Err)) {
+						if (Index >= 0 && Index < IntAryVal[VarId].size) {
+							*ValType = TypInteger;
+						}
+						else {
+							*ValType = TypUnknown;
+						}
+					}
+					break;
+				case TypStrArray:
+					if (GetIndex(&Index, Err)) {
+						VarId = GetStrVarFromArray(VarId, Index, Err);
+						if (*Err == 0) {
+							*ValType = TypString;
+						}
+						else {
+							*ValType = TypUnknown;
+						}
+					}
+					break;
+			}
+		}
+	}
+	else {
+		*ValType = TypUnknown;
+	}
 	
-	if (*Err == ErrVarNotInit) {
-		ValType = TypUnknown;
-	}
-
 	*Err = 0;
 }
 



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