svnno****@sourc*****
svnno****@sourc*****
2015年 8月 25日 (火) 18:17:18 JST
Revision: 5959 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5959 Author: doda Date: 2015-08-25 18:17:18 +0900 (Tue, 25 Aug 2015) Log Message: ----------- /ssh-L, /ssh-R で複数の転送を受け付ける形式を /ssh-L8080:remote:80,2525:remote2:25 に変更する。 /ssh-L8080:remote:80,R8888:localhost:80 のようなローカル/リモート混在を使えなくする。 Revision Links: -------------- http://sourceforge.jp/projects/ttssh2/scm/svn/commits/8888 Modified Paths: -------------- trunk/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/ttxssh.c =================================================================== --- trunk/ttssh2/ttxssh/ttxssh.c 2015-08-25 01:26:34 UTC (rev 5958) +++ trunk/ttssh2/ttxssh/ttxssh.c 2015-08-25 09:17:18 UTC (rev 5959) @@ -1720,21 +1720,31 @@ if (option[4] == 0) { pvar->settings.Enabled = 1; } else if (MATCH_STR(option + 4, "-L") == 0 || - MATCH_STR(option + 4, "-R") == 0 || - _stricmp(option + 4, "-X") == 0) { - // \x93\xE0\x95\x94\x82ł\xCD ; \x82ŋ\xE6\x90\xC1\x82Ă\xA2\x82\xE9\x82̂ŁA, \x82\xF0 ; \x82ɕϊ\xB7\x82\xB7\x82\xE9 - strncpy_s(option2, opt_len, option+5, _TRUNCATE); - for (i=0; i<strlen(option2); i++) { - if (option2[i] == ',') { - option2[i] = ';'; + MATCH_STR(option + 4, "-R") == 0) { + char *p = option + 5; + option2[0] = *p; + i = 1; + while (*++p) { + if (*p == ';' || *p == ',') { + option2[i] = 0; + add_forward_param(pvar, option2); + i = 1; } + else { + option2[i++] = *p; + } } - add_forward_param(pvar, option2); + if (i > 1) { + option2[i] = 0; + add_forward_param(pvar, option2); + } } else if (MATCH_STR(option + 4, "-X") == 0) { add_forward_param(pvar, "X"); - strncpy_s(pvar->settings.X11Display, - sizeof(pvar->settings.X11Display), - option + 6, _TRUNCATE); + if (option+6 != 0) { + strncpy_s(pvar->settings.X11Display, + sizeof(pvar->settings.X11Display), + option + 6, _TRUNCATE); + } } else if (MATCH_STR(option + 4, "-v") == 0) { pvar->settings.LogLevel = LOG_LEVEL_VERBOSE; } else if (_stricmp(option + 4, "-autologin") == 0 ||