svnno****@sourc*****
svnno****@sourc*****
2010年 1月 19日 (火) 21:51:49 JST
Revision: 3736 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3736 Author: doda Date: 2010-01-19 21:51:49 +0900 (Tue, 19 Jan 2010) Log Message: ----------- -d オプションの引数から、二重引用符を削除するようにした。 デスクトップにあるフォルダ等で CygTerm Here を使うと、ディレクトリが二重引用符付きで渡される事があるため。(cygwin 1.7 のみ?) 二重引用符はファイル名に使えないので、単純に削除しても問題ないはず…だよね? # ちょっと自信なし Modified Paths: -------------- trunk/cygterm/README trunk/cygterm/README-j trunk/cygterm/cygterm.cc -------------- next part -------------- Modified: trunk/cygterm/README =================================================================== --- trunk/cygterm/README 2010-01-12 16:41:13 UTC (rev 3735) +++ trunk/cygterm/README 2010-01-19 12:51:49 UTC (rev 3736) @@ -265,6 +265,9 @@ zsh 4.3.4 // C H A N G E S // +v1.07_18 2010/01/19 (by doda) + * Delete doubule quote character from '-d' option's parameter. + v1.07_17 2009/06/16 (by doda) * Added TELNET SGA/ECHO negotiation. Modified: trunk/cygterm/README-j =================================================================== --- trunk/cygterm/README-j 2010-01-12 16:41:13 UTC (rev 3735) +++ trunk/cygterm/README-j 2010-01-19 12:51:49 UTC (rev 3736) @@ -277,6 +277,9 @@ zsh 4.3.4 // $BJQ(B $B99(B $BMz(B $BNr(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 + v1.07_17 2009/06/16 (by doda) * TELNET SGA/ECHO$B%*%W%7%g%s$N%M%4%7%(!<%7%g%s$r9T$&$h$&$K$7$?!#(B Modified: trunk/cygterm/cygterm.cc =================================================================== --- trunk/cygterm/cygterm.cc 2010-01-12 16:41:13 UTC (rev 3735) +++ trunk/cygterm/cygterm.cc 2010-01-19 12:51:49 UTC (rev 3736) @@ -96,9 +96,13 @@ // patch level 17 - added TELNET SGA/ECHO negotiation // Written by IWAMOTO Kouichi. (doda) // +///////////////////////////////////////////////////////////////////////////// +// patch level 17 - delete double quote character from '-d' option's parameter +// Written by IWAMOTO Kouichi. (doda) +// static char Program[] = "CygTerm+"; -static char Version[] = "version 1.07_17 (2009/06/16)"; +static char Version[] = "version 1.07_18 (2010/01/19)"; #include <stdio.h> #include <stdlib.h> @@ -394,6 +398,16 @@ } } +BOOL quote_cut(char *dst, size_t len, char *src) { + while (*src && len > 1) { + if (*src != '"') { + *dst++ = *src; + } + src++; + } + *dst = 0; +} + //=======================// // commandline arguments // //-----------------------// @@ -461,7 +475,8 @@ else if (!strcmp(*argv, "-d")) { // -d <exec directory> if (*++argv == NULL) break; - chdir(*argv); + quote_cut(tmp, sizeof(tmp), *argv); + chdir(tmp); } else if (!strcmp(*argv, "-o")) { // -o <additional option for terminal> if (*++argv == NULL)