[Ttssh2-commit] [5662] Cygwin インストールディレクトリの探し方を変更

svnno****@sourc***** svnno****@sourc*****
2014年 9月 17日 (水) 07:30:59 JST


Revision: 5662
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5662
Author:   maya
Date:     2014-09-17 07:30:51 +0900 (Wed, 17 Sep 2014)
Log Message:
-----------
Cygwin インストールディレクトリの探し方を変更

Modified Paths:
--------------
    trunk/cygterm/cyglaunch.c
    trunk/cygterm/cygterm+-x86_64/cyglaunch.exe
    trunk/teraterm/teraterm/vtwin.cpp

-------------- next part --------------
Modified: trunk/cygterm/cyglaunch.c
===================================================================
--- trunk/cygterm/cyglaunch.c	2014-09-16 15:12:20 UTC (rev 5661)
+++ trunk/cygterm/cyglaunch.c	2014-09-16 22:30:51 UTC (rev 5662)
@@ -40,16 +40,28 @@
 	}
 
 	_snprintf(file, MAX_PATH, "%s\\bin", CygwinDirectory);
-	if (GetFileAttributes(file) == -1) { // open error
-		for (c = 'C' ; c <= 'Z' ; c++) {
-			file[0] = c;
-			if (GetFileAttributes(file) != -1) { // open success
-				goto found_dll;
-			}
+	if (GetFileAttributes(file) != -1) { // open success
+		goto found_dll;
+	}
+
+	strcpy(file, "C:\\cygwin\\bin");
+	for (c = 'C' ; c <= 'Z' ; c++) {
+		file[0] = c;
+		if (GetFileAttributes(file) != -1) { // open success
+			goto found_dll;
 		}
-		MessageBox(NULL, "Can't find Cygwin directory.", "ERROR", MB_OK | MB_ICONWARNING);
-		return;
 	}
+	strcpy(file, "C:\\cygwin64\\bin");
+	for (c = 'C' ; c <= 'Z' ; c++) {
+		file[0] = c;
+		if (GetFileAttributes(file) != -1) { // open success
+			goto found_dll;
+		}
+	}
+
+	MessageBox(NULL, "Can't find Cygwin directory.", "ERROR", MB_OK | MB_ICONWARNING);
+	return;
+
 found_dll:;
 	if (envptr != NULL) {
 		envbufflen = strlen(file) + strlen(envptr) + 7; // "PATH="(5) + ";"(1) + NUL(1)

Modified: trunk/cygterm/cygterm+-x86_64/cyglaunch.exe
===================================================================
(Binary files differ)

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2014-09-16 15:12:20 UTC (rev 5661)
+++ trunk/teraterm/teraterm/vtwin.cpp	2014-09-16 22:30:51 UTC (rev 5662)
@@ -3745,19 +3745,31 @@
 	}
 
 	_snprintf_s(file, sizeof(file), _TRUNCATE, "%s\\bin", ts.CygwinDirectory);
-	if (GetFileAttributes(file) == -1) { // open error
-		for (c = 'C' ; c <= 'Z' ; c++) {
-			file[0] = c;
-			if (GetFileAttributes(file) != -1) { // open success
-				goto found_dll;
-			}
+	if (GetFileAttributes(file) != -1) { // open success
+		goto found_dll;
+	}
+
+	_snprintf_s(file, sizeof(file), _TRUNCATE, "C:\\cygwin\\bin");
+	for (c = 'C' ; c <= 'Z' ; c++) {
+		file[0] = c;
+		if (GetFileAttributes(file) != -1) { // open success
+			goto found_dll;
 		}
-		get_lang_msg("MSG_ERROR", uimsg, sizeof(uimsg), "ERROR", ts.UILanguageFile);
-		get_lang_msg("MSG_FIND_CYGTERM_DIR_ERROR", ts.UIMsg, sizeof(ts.UIMsg),
-		             "Can't find Cygwin directory.", ts.UILanguageFile);
-		::MessageBox(NULL, ts.UIMsg, uimsg, MB_OK | MB_ICONWARNING);
-		return;
 	}
+	_snprintf_s(file, sizeof(file), _TRUNCATE, "C:\\cygwin64\\bin");
+	for (c = 'C' ; c <= 'Z' ; c++) {
+		file[0] = c;
+		if (GetFileAttributes(file) != -1) { // open success
+			goto found_dll;
+		}
+	}
+
+	get_lang_msg("MSG_ERROR", uimsg, sizeof(uimsg), "ERROR", ts.UILanguageFile);
+	get_lang_msg("MSG_FIND_CYGTERM_DIR_ERROR", ts.UIMsg, sizeof(ts.UIMsg),
+	             "Can't find Cygwin directory.", ts.UILanguageFile);
+	::MessageBox(NULL, ts.UIMsg, uimsg, MB_OK | MB_ICONWARNING);
+	return;
+
 found_dll:;
 	if (envptr != NULL) {
 		envbufflen = strlen(file) + strlen(envptr) + 7; // "PATH="(5) + ";"(1) + NUL(1)



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