svnno****@sourc*****
svnno****@sourc*****
2013年 5月 24日 (金) 16:31:38 JST
Revision: 5277 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5277 Author: doda Date: 2013-05-24 16:31:38 +0900 (Fri, 24 May 2013) Log Message: ----------- waitregex で複数のパラメータが同時にマッチする場合に前の方を優先するように変更。 http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=31374 Modified Paths: -------------- trunk/teraterm/ttpmacro/ttmdde.c -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/ttmdde.c =================================================================== --- trunk/teraterm/ttpmacro/ttmdde.c 2013-05-24 00:56:34 UTC (rev 5276) +++ trunk/teraterm/ttpmacro/ttmdde.c 2013-05-24 07:31:38 UTC (rev 5277) @@ -613,8 +613,7 @@ // \x90\xB3\x8BK\x95\\x8C\xBB\x82ɂ\xE6\x82\xE9\x83p\x83^\x81[\x83\x93\x83}\x83b\x83`\x82\xF0\x8Ds\x82\xA4 int FindRegexString(void) { - int i, Found = 0; - PCHAR Str; + int i; if (RegexActionType == REGEX_NONE) return 0; // not match @@ -622,23 +621,18 @@ if (RecvLnPtr == 0) return 0; // not match - for (i = 9 ; i >= 0 ; i--) { - Str = PWaitStr[i]; // regex pattern - if (Str!=NULL) { - if (FindRegexStringOne(Str, strlen(Str), RecvLnBuff, RecvLnPtr) > 0) { // matched - Found = i+1; + for (i = 0 ; i < 10 ; i++) { + if (PWaitStr[i] && FindRegexStringOne(PWaitStr[i], WaitStrLen[i], RecvLnBuff, RecvLnPtr) > 0) { // matched + // \x83}\x83b\x83`\x82\xB5\x82\xBD\x8Ds\x82\xF0 inputstr \x82֊i\x94[\x82\xB7\x82\xE9 + LockVar(); + SetInputStr(GetRecvLnBuff()); // \x82\xB1\x82\xB1\x82Ńo\x83b\x83t\x83@\x82\xAA\x83N\x83\x8A\x83A\x82\xB3\x82\xEA\x82\xE9 + UnlockVar(); - // \x83}\x83b\x83`\x82\xB5\x82\xBD\x8Ds\x82\xF0 inputstr \x82֊i\x94[\x82\xB7\x82\xE9 - LockVar(); - SetInputStr(GetRecvLnBuff()); // \x82\xB1\x82\xB1\x82Ńo\x83b\x83t\x83@\x82\xAA\x83N\x83\x8A\x83A\x82\xB3\x82\xEA\x82\xE9 - UnlockVar(); - - break; - } + return i+1; } } - return (Found); + return 0; }