svnno****@sourc*****
svnno****@sourc*****
2009年 8月 29日 (土) 01:19:17 JST
Revision: 3614 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3614 Author: yutakapon Date: 2009-08-29 01:19:17 +0900 (Sat, 29 Aug 2009) Log Message: ----------- ã¯ãªãã«ãã«URLã®ãã¬ãã£ãã¯ã¹ããã¤ã³ã¿é åã«å®ç¾©ãç´ããã Modified Paths: -------------- trunk/teraterm/teraterm/buffer.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/buffer.c =================================================================== --- trunk/teraterm/teraterm/buffer.c 2009-08-28 05:00:15 UTC (rev 3613) +++ trunk/teraterm/teraterm/buffer.c 2009-08-28 16:19:17 UTC (rev 3614) @@ -1355,6 +1355,16 @@ * other: url head char --> url_table array number + 1 */ }; + static char *prefix[] = { + "https://", + "http://", + "sftp://", + "tftp://", + "news://", + "ftp://", + "mms://", + NULL + }; unsigned char ch = CodeLine[x]; if (ts.EnableClickableUrl == FALSE) @@ -1383,33 +1393,18 @@ int i, len = -1; RECT rc; int CaretX, CaretY; + char **p = prefix; - if ((x-6>=0) && !strncmp(&CodeLine[x-6], "http", 4)) { - len = 6; + while (*p) { + len = strlen(*p) - 1; + if ((x-len>=0) && !strncmp(&CodeLine[x-len], *p, len)) { + for (i = 0; i <= len; i++) { + AttrLine[x-i] |= (AttrURL | AttrUnder); + } + break; + } + p++; } - else if ((x-7>=0) && !strncmp(&CodeLine[x-7], "https", 5)) { - len = 7; - } - else if ((x-6>=0) && !strncmp(&CodeLine[x-6], "news", 4)) { - len = 6; - } - else if ((x-6>=0) && !strncmp(&CodeLine[x-6], "sftp", 4)) { - len = 6; - } - else if ((x-5>=0) && !strncmp(&CodeLine[x-5], "ftp", 3)) { - len = 5; - } - else if ((x-5>=0) && !strncmp(&CodeLine[x-5], "mms", 3)) { - len = 5; - } -#if 0 - if ((x-5>=0) && !strncmp(&CodeLine[x-5], "ttp", 3)) { - len = 5; - } -#endif - for (i = 0; i <= len; i++) { - AttrLine[x-i] |= (AttrURL | AttrUnder); - } /* nCp[NÌF®«ÏXÍA·ÅÉæÊÖoÍãÉAobt@ðkÁÄ URL ®«ð * t¯¼·Æ¢¤WbNÅ é½ßAFª³µ`æ³êÈ¢êª éB