[Ttssh2-commit] [4198] ViewlogEditor のデフォルト値をフルパスにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 11月 30日 (火) 20:49:01 JST


Revision: 4198
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4198
Author:   doda
Date:     2010-11-30 20:49:00 +0900 (Tue, 30 Nov 2010)

Log Message:
-----------
ViewlogEditor のデフォルト値をフルパスにした。

Modified Paths:
--------------
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2010-11-30 05:04:12 UTC (rev 4197)
+++ trunk/teraterm/ttpset/ttset.c	2010-11-30 11:49:00 UTC (rev 4198)
@@ -1155,10 +1155,14 @@
 	          _TRUNCATE);
 
 	// Viewlog Editor path
-	GetPrivateProfileString(Section, "ViewlogEditor ", "notepad.exe",
-	                        Temp, sizeof(Temp), FName);
-	strncpy_s(ts->ViewlogEditor, sizeof(ts->ViewlogEditor), Temp,
-	          _TRUNCATE);
+	if (GetWindowsDirectory(Temp, sizeof(Temp)) + 13 < sizeof(Temp)) { // "\\notepad.exe"(12) + NUL(1)
+		strncat_s(Temp, sizeof(Temp), "\\notepad.exe", _TRUNCATE);
+	}
+	else {
+		Temp[0] = '\0';
+	}
+	GetPrivateProfileString(Section, "ViewlogEditor ", Temp,
+	                        ts->ViewlogEditor, sizeof(ts->ViewlogEditor), FName);
 
 	// Locale for UTF-8
 	GetPrivateProfileString(Section, "Locale ", DEFAULT_LOCALE,



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