[Ttssh2-commit] [6473] オプションのチェックを厳密にした

svnno****@sourc***** svnno****@sourc*****
2016年 8月 22日 (月) 17:34:05 JST


Revision: 6473
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6473
Author:   doda
Date:     2016-08-22 17:34:04 +0900 (Mon, 22 Aug 2016)
Log Message:
-----------
オプションのチェックを厳密にした

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2016-08-22 08:34:02 UTC (rev 6472)
+++ trunk/doc/en/html/about/history.html	2016-08-22 08:34:04 UTC (rev 6473)
@@ -2779,6 +2779,7 @@
     <ul>
       <li>When the filename includes invalid character by SCP receiving, the character is be replaced to '_'.</li>
       <li>The default value of ScpSendDir entry is changed from "~/" to ""(empty string).</li>
+      <!-- li><a href="../commandline/ttssh.html">\x83R\x83}\x83\x93\x83h\x83\x89\x83C\x83\x93\x83I\x83v\x83V\x83\x87\x83\x93</a>\x82̎\xAF\x95ʂ\xF0\x8C\xB5\x96\xA7\x82ɂ\xB5\x82\xBD\x81B/ssh-A \x82Ȃǂ̈ꕔ\x82̃I\x83v\x83V>\x83\x87\x83\x93\x82\xC5 /ssh-Axx \x82̂悤\x82Ɍ\xE3\x82\xEB\x82ɗ]\x8Cv\x82ȕ\xB6\x8E\x9A\x97񂪕t\x82\xA2\x82Ă\xA2\x82\xA2\x82Ă\xE0\x83I\x83v\x83V\x83\x87\x83\x93\x82Ƃ\xB5\x82Ĉ\xB5\x82\xC1\x82Ă\xA2\x82\xBD\x82\xAA\x81A\x82\xB1\x82\xEA\x82\xF0\x88\xB5\x82\xED\x82Ȃ\xAD\x82\xB5\x82\xBD\x81B</li -->
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2016-08-22 08:34:02 UTC (rev 6472)
+++ trunk/doc/ja/html/about/history.html	2016-08-22 08:34:04 UTC (rev 6473)
@@ -2784,6 +2784,7 @@
     <ul>
       <li>scp \x82ł̃t\x83@\x83C\x83\x8B\x8E\xF3\x90M\x82ŁA\x83t\x83@\x83C\x83\x8B\x96\xBC\x82Ɏg\x82\xA6\x82Ȃ\xA2\x95\xB6\x8E\x9A\x82\xAA\x8A܂܂\xEA\x82Ă\xA2\x82\xBD\x8Fꍇ\x82ɁA\x82\xBB\x82̕\xB6\x8E\x9A\x82\xF0 _ \x82ɒu\x82\xAB\x8A\xB7\x82\xA6\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
       <li>ScpSendDir \x82̃f\x83t\x83H\x83\x8B\x83g\x92l\x82\xF0 "~/" \x82\xA9\x82\xE7 "" (\x8B󕶎\x9A\x97\xF1) \x82ɕύX\x82\xB5\x82\xBD\x81B</li>
+      <li><a href="../commandline/ttssh.html">\x83R\x83}\x83\x93\x83h\x83\x89\x83C\x83\x93\x83I\x83v\x83V\x83\x87\x83\x93</a>\x82̎\xAF\x95ʂ\xF0\x8C\xB5\x96\xA7\x82ɂ\xB5\x82\xBD\x81B/ssh-A \x82Ȃǂ̈ꕔ\x82̃I\x83v\x83V\x83\x87\x83\x93\x82\xC5 /ssh-Axx \x82̂悤\x82Ɍ\xE3\x82\xEB\x82ɗ]\x8Cv\x82ȕ\xB6\x8E\x9A\x97񂪕t\x82\xA2\x82Ă\xA2\x82\xA2\x82Ă\xE0\x83I\x83v\x83V\x83\x87\x83\x93\x82Ƃ\xB5\x82Ĉ\xB5\x82\xC1\x82Ă\xA2\x82\xBD\x82\xAA\x81A\x82\xB1\x82\xEA\x82\xF0\x88\xB5\x82\xED\x82Ȃ\xAD\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2016-08-22 08:34:02 UTC (rev 6472)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2016-08-22 08:34:04 UTC (rev 6473)
@@ -1869,7 +1869,7 @@
 						          sizeof(pvar->settings.X11Display),
 						          option + 6, _TRUNCATE);
 					}
-				} else if (MATCH_STR(option + 4, "-v") == 0) {
+				} else if (strcmp(option + 4, "-v") == 0) {
 					pvar->settings.LogLevel = LOG_LEVEL_VERBOSE;
 				} else if (_stricmp(option + 4, "-autologin") == 0 ||
 				           _stricmp(option + 4, "-autologon") == 0) {
@@ -1885,11 +1885,9 @@
 					else {
 						pvar->settings.ForwardAgentConfirm = 1;
 					}
-
-				// -axx\x82\xE6\x82\xE8\x8F\xE3\x82ɂ\xB5\x82Ă͂\xBE\x82\xDF
-				} else if (MATCH_STR(option + 4, "-a") == 0) {
+				} else if (strcmp(option + 4, "-a") == 0) {
 					pvar->settings.ForwardAgent = FALSE;
-				} else if (MATCH_STR(option + 4, "-A") == 0) {
+				} else if (strcmp(option + 4, "-A") == 0) {
 					pvar->settings.ForwardAgent = TRUE;
 
 				} else if (MATCH_STR(option + 4, "-C=") == 0) {
@@ -1900,9 +1898,9 @@
 					else if (pvar->settings.CompressionLevel > 9) {
 						pvar->settings.CompressionLevel = 9;
 					}
-				} else if (MATCH_STR(option + 4, "-C") == 0) {
+				} else if (strcmp(option + 4, "-C") == 0) {
 					pvar->settings.CompressionLevel = 6;
-				} else if (MATCH_STR(option + 4, "-c") == 0) {
+				} else if (strcmp(option + 4, "-c") == 0) {
 					pvar->settings.CompressionLevel = 0;
 				} else if (MATCH_STR_I(option + 4, "-icon=") == 0) {
 					if ((_stricmp(option+10, "old") == 0) ||
@@ -1919,10 +1917,10 @@
 					}
 
 				// /ssh1 \x82\xC6 /ssh2 \x83I\x83v\x83V\x83\x87\x83\x93\x82̐V\x8BK\x92lj\xC1 (2006.9.16 maya)
-				} else if (MATCH_STR(option + 4, "1") == 0) {
+				} else if (strcmp(option + 4, "1") == 0) {
 					pvar->settings.Enabled = 1;
 					pvar->settings.ssh_protocol_version = 1;
-				} else if (MATCH_STR(option + 4, "2") == 0) {
+				} else if (strcmp(option + 4, "2") == 0) {
 					pvar->settings.Enabled = 1;
 					pvar->settings.ssh_protocol_version = 2;
 
@@ -1947,21 +1945,21 @@
 				}
 
 			// /1 \x82\xA8\x82\xE6\x82\xD1 /2 \x83I\x83v\x83V\x83\x87\x83\x93\x82̐V\x8BK\x92lj\xC1 (2004.10.3 yutaka)
-			} else if (MATCH_STR(option + 1, "1") == 0) {
+			} else if (strcmp(option + 1, "1") == 0) {
 				// command line: /ssh /1 is SSH1 only
 				pvar->settings.ssh_protocol_version = 1;
 
-			} else if (MATCH_STR(option + 1, "2") == 0) {
+			} else if (strcmp(option + 1, "2") == 0) {
 				// command line: /ssh /2 is SSH2 & SSH1
 				pvar->settings.ssh_protocol_version = 2;
 
-			} else if (MATCH_STR(option + 1, "nossh") == 0) {
+			} else if (strcmp(option + 1, "nossh") == 0) {
 				// '/nossh' \x83I\x83v\x83V\x83\x87\x83\x93\x82̒lj\xC1\x81B
 				// TERATERM.INI \x82\xC5SSH\x82\xAA\x97L\x8C\xF8\x82ɂȂ\xC1\x82Ă\xA2\x82\xE9\x8Fꍇ\x81A\x82\xA4\x82܂\xADCygterm\x82\xAA\x8BN\x93\xAE\x82\xB5\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA
 				// \x82\xA0\x82邱\x82Ƃւ̑Ώ\x88\x81B(2004.10.11 yutaka)
 				pvar->settings.Enabled = 0;
 
-			} else if (MATCH_STR(option + 1, "telnet") == 0) {
+			} else if (strcmp(option + 1, "telnet") == 0) {
 				// '/telnet' \x82\xAA\x8Ew\x92肳\x82\xEA\x82Ă\xA2\x82\xE9\x82Ƃ\xAB\x82ɂ\xCD '/nossh' \x82Ɠ\xAF\x82\xB6\x82\xAD
 				// SSH\x82𖳌\xF8\x82ɂ\xB7\x82\xE9 (2006.9.16 maya)
 				pvar->settings.Enabled = 0;
@@ -1968,7 +1966,7 @@
 				// Tera Term \x82\xCC Telnet \x83t\x83\x89\x83O\x82\xE0\x95t\x82\xAF\x82\xE9
 				pvar->ts->Telnet = 1;
 
-			} else if (MATCH_STR(option + 1, "auth") == 0) {
+			} else if (MATCH_STR(option + 1, "auth=") == 0) {
 				// SSH2\x8E\xA9\x93\xAE\x83\x8D\x83O\x83C\x83\x93\x83I\x83v\x83V\x83\x87\x83\x93\x82̒lj\xC1
 				//
 				// SYNOPSIS: /ssh /auth=passowrd /user=\x83\x86\x81[\x83U\x96\xBC /passwd=\x83p\x83X\x83\x8F\x81[\x83h
@@ -1980,26 +1978,25 @@
 				//
 				pvar->ssh2_autologin = 1; // for SSH2 (2004.11.30 yutaka)
 
-				if (MATCH_STR(option + 5, "=password") == 0) { // \x83p\x83X\x83\x8F\x81[\x83h
+				if (_stricmp(option + 6, "password") == 0) { // \x83p\x83X\x83\x8F\x81[\x83h
 					//pvar->auth_state.cur_cred.method = SSH_AUTH_PASSWORD;
 					pvar->ssh2_authmethod = SSH_AUTH_PASSWORD;
 
 				// /auth=challenge \x82\xF0\x92lj\xC1 (2007.10.5 maya)
-				} else if (MATCH_STR(option + 5, "=challenge") == 0) { // keyboard-interactive\x94F\x8F\xD8
+				} else if (_stricmp(option + 6, "challenge") == 0) { // keyboard-interactive\x94F\x8F\xD8
 					//pvar->auth_state.cur_cred.method = SSH_AUTH_TIS;
 					pvar->ssh2_authmethod = SSH_AUTH_TIS;
 
-				} else if (MATCH_STR(option + 5, "=publickey") == 0) { // \x8C\xF6\x8AJ\x8C\xAE\x94F\x8F\xD8
+				} else if (_stricmp(option + 6, "publickey") == 0) { // \x8C\xF6\x8AJ\x8C\xAE\x94F\x8F\xD8
 					//pvar->auth_state.cur_cred.method = SSH_AUTH_RSA;
 					pvar->ssh2_authmethod = SSH_AUTH_RSA;
 
-				} else if (MATCH_STR(option + 5, "=pageant") == 0) { // \x8C\xF6\x8AJ\x8C\xAE\x94F\x8F\xD8 by Pageant
+				} else if (_stricmp(option + 6, "pageant") == 0) { // \x8C\xF6\x8AJ\x8C\xAE\x94F\x8F\xD8 by Pageant
 					//pvar->auth_state.cur_cred.method = SSH_AUTH_RSA;
 					pvar->ssh2_authmethod = SSH_AUTH_PAGEANT;
 
 				} else {
 					// TODO:
-
 				}
 
 			} else if (MATCH_STR(option + 1, "user=") == 0) {
@@ -2011,11 +2008,11 @@
 			} else if (MATCH_STR(option + 1, "keyfile=") == 0) {
 				_snprintf_s(pvar->ssh2_keyfile, sizeof(pvar->ssh2_keyfile), _TRUNCATE, "%s", option+9);
 
-			} else if (MATCH_STR(option + 1, "ask4passwd") == 0) {
+			} else if (strcmp(option + 1, "ask4passwd") == 0) {
 				// \x83p\x83X\x83\x8F\x81[\x83h\x82𕷂\xAD (2006.9.18 maya)
 				pvar->ask4passwd = 1;
 
-			} else if (MATCH_STR(option + 1, "nosecuritywarning") == 0) {
+			} else if (strcmp(option + 1, "nosecuritywarning") == 0) {
 				// known_hosts\x83`\x83F\x83b\x83N\x82\xF0\x82\xB5\x82Ȃ\xA2\x81B\x93\x96\x8AY\x83I\x83v\x83V\x83\x87\x83\x93\x82\xF0\x8Eg\x82\xA4\x82ƁA\x83Z\x83L\x83\x85\x83\x8A\x83e\x83B\x90\xAB\x82\xAA\x92ቺ\x82\xB7\x82\xE9
 				// \x82\xBD\x82߁A\x89B\x82\xB5\x83I\x83v\x83V\x83\x87\x83\x93\x88\xB5\x82\xA2\x82Ƃ\xB7\x82\xE9\x81B
 				// (2009.10.4 yutaka)



Ttssh2-commit メーリングリストの案内