svnno****@sourc*****
svnno****@sourc*****
2009年 7月 6日 (月) 12:23:54 JST
Revision: 3581 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3581 Author: doda Date: 2009-07-06 12:23:54 +0900 (Mon, 06 Jul 2009) Log Message: ----------- strscanãæ£ããåããªãå ´åãããã®ãä¿®æ£ã ãã ããã¾ã strscan "ä¸è¦§è¡¨D" "\D" ãããããããããã http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=17613 Modified Paths: -------------- trunk/doc/en/html/about/history.html trunk/doc/ja/html/about/history.html trunk/teraterm/ttpmacro/ttl.c -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2009-07-06 03:10:47 UTC (rev 3580) +++ trunk/doc/en/html/about/history.html 2009-07-06 03:23:54 UTC (rev 3581) @@ -41,6 +41,7 @@ <ul> <!--li>Ú±OÉsÁ½[JGR[ÆMüsR[hÌÝ誳³êéª éÌðC³µ½B</li--> <!--li>VAÚ±ÉAOÌÚ±Ågíê½TCPLocalEcho/TCPCRSendÌÝèªZbg³êÈ¢ÌðC³µ½B</li--> + <li>Bug fix: <a href="../macro/command/strscan.html">strscan</a> macro command does not work correctly. </li> </ul> </li> Modified: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2009-07-06 03:10:47 UTC (rev 3580) +++ trunk/doc/ja/html/about/history.html 2009-07-06 03:23:54 UTC (rev 3581) @@ -41,6 +41,7 @@ <ul> <li>Ú±OÉsÁ½[JGR[ÆMüsR[hÌÝ誳³êéª éÌðC³µ½B</li> <li>VAÚ±ÉAOÌÚ±Ågíê½TCPLocalEcho/TCPCRSendÌÝèªZbg³êÈ¢ÌðC³µ½B<li--> + <li>}NR}h "<a href="../macro/command/strscan.html">strscan</a>" ª³µ©È¢êª éÌðC³µ½B</li> </ul> </li> Modified: trunk/teraterm/ttpmacro/ttl.c =================================================================== --- trunk/teraterm/ttpmacro/ttl.c 2009-07-06 03:10:47 UTC (rev 3580) +++ trunk/teraterm/ttpmacro/ttl.c 2009-07-06 03:23:54 UTC (rev 3581) @@ -3159,8 +3159,8 @@ WORD TTLStrScan() { WORD Err; - int Len1, Len2, i, j; TStrVal Str1, Str2; + char *p; Err = 0; GetStrVal(Str1,&Err); @@ -3169,31 +3169,17 @@ Err = ErrSyntax; if (Err!=0) return Err; - Len1 = strlen(Str1); - Len2 = strlen(Str2); - if ((Len1==0) || (Len2==0)) - { + if ((Str1[0] == 0) || (Str2[0] == 0)) { SetResult(0); return Err; } - i = 0; - j = 0; - do { - if (Str1[i]==Str2[j]) - { - j++; - i++; - } - else if (j==0) - i++; - else - j = 0; - } while ((i<Len1) && (j<Len2)); - if (j==Len2) - SetResult(i-Len2+1); - else + if ((p = strstr(Str1, Str2)) != NULL) { + SetResult(p - Str1 + 1); + } + else { SetResult(0); + } return Err; }