svnno****@sourc*****
svnno****@sourc*****
2010年 1月 28日 (木) 19:20:15 JST
Revision: 3748 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3748 Author: doda Date: 2010-01-28 19:20:15 +0900 (Thu, 28 Jan 2010) Log Message: ----------- '-s' オプションの引数に 'AUTO' を受け付けるようにした。 Modified Paths: -------------- trunk/cygterm/README trunk/cygterm/README-j trunk/cygterm/cygterm.cc -------------- next part -------------- Modified: trunk/cygterm/README =================================================================== --- trunk/cygterm/README 2010-01-28 09:56:12 UTC (rev 3747) +++ trunk/cygterm/README 2010-01-28 10:20:15 UTC (rev 3748) @@ -265,6 +265,9 @@ zsh 4.3.4 // C H A N G E S // +v1.07_19 2010/01/28 (by doda) + * Accept keyword "AUTO" with '-s' option. + v1.07_18 2010/01/19 (by doda) * Delete doubule quote character from '-d' option's parameter. Modified: trunk/cygterm/README-j =================================================================== --- trunk/cygterm/README-j 2010-01-28 09:56:12 UTC (rev 3747) +++ trunk/cygterm/README-j 2010-01-28 10:20:15 UTC (rev 3748) @@ -277,6 +277,9 @@ zsh 4.3.4 // $BJQ(B $B99(B $BMz(B $BNr(B // +v1.07_19 2010/01/28 (by doda) + * '-s' $B%*%W%7%g%s$N0z?t$K(B 'AUTO' $B$r<u$1IU$1$k$h$&$K$7$?!#(B + v1.07_18 2010/01/19 (by doda) * '-d' $B%*%W%7%g%s$N0z?t$+$iFs=E0zMQId$r:o=|$9$k$h$&$K$7$?!#(B Modified: trunk/cygterm/cygterm.cc =================================================================== --- trunk/cygterm/cygterm.cc 2010-01-28 09:56:12 UTC (rev 3747) +++ trunk/cygterm/cygterm.cc 2010-01-28 10:20:15 UTC (rev 3748) @@ -100,9 +100,13 @@ // patch level 18 - delete double quote character from '-d' option's parameter // Written by IWAMOTO Kouichi. (doda) // +///////////////////////////////////////////////////////////////////////////// +// patch level 19 - accept keyword "AUTO" with '-s' option +// Written by IWAMOTO Kouichi. (doda) +// static char Program[] = "CygTerm+"; -static char Version[] = "version 1.07_18 (2010/01/19)"; +static char Version[] = "version 1.07_19 (2010/01/28)"; #include <stdio.h> #include <stdlib.h> @@ -144,6 +148,7 @@ char cmd_term[256] = ""; char cmd_termopt[256] = ""; char cmd_shell[128] = ""; +char pw_shell[128] = ""; // TCP port for connection to another terminal application //-------------------------------------------------------- @@ -254,8 +259,11 @@ // shell command line if (strcasecmp(val, "AUTO") != 0) { strncpy(cmd_shell, val, sizeof(cmd_shell)-1); - cmd_shell[sizeof(cmd_shell)-1] = 0; } + else { + strncpy(cmd_shell, pw_shell, sizeof(cmd_shell)-1); + } + cmd_shell[sizeof(cmd_shell)-1] = 0; } else if (!strcasecmp(name, "PORT_START")) { // minimum port# for TELNET @@ -345,6 +353,9 @@ if (username != NULL) { struct passwd* pw_ent = getpwnam(username); if (pw_ent != NULL) { + strncpy(pw_shell, pw_ent->pw_shell, sizeof(pw_shell)-1); + pw_shell[sizeof(pw_shell)-1] = 0; + strcpy(usr_conf, pw_ent->pw_dir); strcat(usr_conf, "/."); strcat(usr_conf, bs + 1); @@ -434,7 +445,12 @@ else if (!strcmp(*argv, "-s")) { // -s <shell> if (*++argv == NULL) break; - strncpy(cmd_shell, *argv, sizeof(cmd_shell)-1); + if (strcasecmp(*argv, "AUTO") != 0) { + strncpy(cmd_shell, *argv, sizeof(cmd_shell)-1); + } + else { + strncpy(cmd_shell, pw_shell, sizeof(cmd_shell)-1); + } cmd_shell[sizeof(cmd_shell)-1] = '\0'; } else if (!strcmp(*argv, "-cd")) { // -cd