[Ttssh2-commit] [5874] コマンドライン引数の1番目は ttermpro.exe になるのでスキップするようにした

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2015年 5月 16日 (土) 23:45:47 JST


Revision: 5874
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5874
Author:   maya
Date:     2015-05-16 23:45:47 +0900 (Sat, 16 May 2015)
Log Message:
-----------
コマンドライン引数の1番目は ttermpro.exe になるのでスキップするようにした

Modified Paths:
--------------
    trunk/TTProxy/TTProxy.h
    trunk/TTXSamples/TTXCommandLineOpt/TTXCommandLineOpt.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/TTProxy/TTProxy.h
===================================================================
--- trunk/TTProxy/TTProxy.h	2015-05-16 14:33:41 UTC (rev 5873)
+++ trunk/TTProxy/TTProxy.h	2015-05-16 14:45:47 UTC (rev 5874)
@@ -131,11 +131,14 @@
 		char option[1024];
 		int opt_len = sizeof(option);
 		int action;
-		PCHAR cur, next;
+		PCHAR start, cur, next;
 
 		memset(&option, '\0', opt_len);
 
-		cur = param;
+		/* the first term shuld be executable filename of Tera Term */
+		start = GetParam(option, opt_len, param);
+
+		cur = start;
 		while (next = GetParam(option, opt_len, cur)) {
 			action = OPTION_NONE;
 
@@ -158,7 +161,7 @@
 			cur = next;
 		}
 
-		cur = param;
+		cur = start;
 		while (next = GetParam(option, opt_len, cur)) {	
 			action = OPTION_NONE;
 

Modified: trunk/TTXSamples/TTXCommandLineOpt/TTXCommandLineOpt.c
===================================================================
--- trunk/TTXSamples/TTXCommandLineOpt/TTXCommandLineOpt.c	2015-05-16 14:33:41 UTC (rev 5873)
+++ trunk/TTXSamples/TTXCommandLineOpt/TTXCommandLineOpt.c	2015-05-16 14:45:47 UTC (rev 5874)
@@ -57,10 +57,13 @@
 
 static void PASCAL FAR TTXParseParam(PCHAR Param, PTTSet ts, PCHAR DDETopic) {
   char buff[1024];
-  PCHAR cur, next;
+  PCHAR start, cur, next;
   int x, y;
 
-  cur = Param;
+  /* the first term shuld be executable filename of Tera Term */
+  start = GetParam(buff, sizeof(buff), Param);
+
+  cur = start;
   while (next = GetParam(buff, sizeof(buff), cur)) {
     if (_strnicmp(buff, "/FG=", 4) == 0) {
       ColorStr2ColorRef(&(ts->VTColor[0]), &buff[4]);

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2015-05-16 14:33:41 UTC (rev 5873)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2015-05-16 14:45:47 UTC (rev 5874)
@@ -1638,13 +1638,16 @@
 	int opt_len = param_len+1;
 	char *option = (char *)calloc(opt_len, sizeof(char));
 	int action;
-	PCHAR cur, next;
+	PCHAR start, cur, next;
 
 	if (pvar->hostdlg_activated) {
 		pvar->settings.Enabled = pvar->hostdlg_Enabled;
 	}
 
-	cur = param;
+	/* the first term shuld be executable filename of Tera Term */
+	start = GetParam(option, opt_len, param);
+
+	cur = start;
 	while (next = GetParam(option, opt_len, cur)) {
 		action = OPTION_NONE;
 
@@ -1679,7 +1682,7 @@
 		cur = next;
 	}
 
-	cur = param;
+	cur = start;
 	while (next = GetParam(option, opt_len, cur)) {	
 		action = OPTION_NONE;
 



Ttssh2-commit メーリングリストの案内
Back to archive index