[Ttssh2-commit] [4963] [Hosts] セクションのHostを、数字が飛んでいても読み込むようにした

svnno****@sourc***** svnno****@sourc*****
2012年 6月 10日 (日) 01:01:28 JST


Revision: 4963
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/4963
Author:   maya
Date:     2012-06-10 01:01:25 +0900 (Sun, 10 Jun 2012)
Log Message:
-----------
[Hosts]セクションのHostを、数字が飛んでいても読み込むようにした
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=28679

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpset/ttset.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2012-06-08 13:20:26 UTC (rev 4962)
+++ trunk/doc/en/html/about/history.html	2012-06-09 16:01:25 UTC (rev 4963)
@@ -31,12 +31,11 @@
 
 <h2><a name="teraterm">Tera Term</a></h2>
 
-
 <h3><a name="teraterm_4.75">2012.xx.xx (Ver 4.75 not released yet)</a></h3>
 <ul class="history">
   <li>Changes
     <ul>
-      <li></li>
+      <!--li>TERATERM.INI \x82\xCC [Hosts] \x83Z\x83N\x83V\x83\x87\x83\x93\x82ŁAHost\x82ɑ\xB1\x82\xAD\x90\x94\x8E\x9A\x82\xAA\x94\xF2\x82\xF1\x82ł\xA2\x82Ă\xE0\x91\xB1\x82\xAB\x82\xF0\x93ǂނ悤\x82ɂ\xB5\x82\xBD\x81B</li-->
     </ul>
   </li>
 
@@ -59,7 +58,6 @@
 </ul>
 
 
-
 <h3><a name="teraterm_4.74">2012.05.31 (Ver 4.74)</a></h3>
 <ul class="history">
   <li>Changes

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2012-06-08 13:20:26 UTC (rev 4962)
+++ trunk/doc/ja/html/about/history.html	2012-06-09 16:01:25 UTC (rev 4963)
@@ -35,7 +35,7 @@
 <ul class="history">
   <li>\x95ύX
     <ul>
-      <li></li>
+      <li>TERATERM.INI \x82\xCC [Hosts] \x83Z\x83N\x83V\x83\x87\x83\x93\x82ŁAHost\x82ɑ\xB1\x82\xAD\x90\x94\x8E\x9A\x82\xAA\x94\xF2\x82\xF1\x82ł\xA2\x82Ă\xE0\x91\xB1\x82\xAB\x82\xF0\x93ǂނ悤\x82ɂ\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2012-06-08 13:20:26 UTC (rev 4962)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2012-06-09 16:01:25 UTC (rev 4963)
@@ -1619,7 +1619,7 @@
 					                   0, (LPARAM)TempHost);
 				}
 				i++;
-			} while ((i <= MAXHOSTLIST) && (strlen(TempHost)>0));
+			} while (i <= MAXHOSTLIST);
 
 			/* append a blank item to the bottom */
 			TempHost[0] = 0;
@@ -2009,7 +2009,7 @@
 					                   0, (LPARAM)TempHost);
 				}
 				i++;
-			} while ((i <= MAXHOSTLIST) && (strlen(TempHost)>0));
+			} while (i <= MAXHOSTLIST);
 
 			SendDlgItemMessage(Dialog, IDC_HOSTNAME, EM_LIMITTEXT,
 			                   HostNameMaxLength-1, 0);

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2012-06-08 13:20:26 UTC (rev 4962)
+++ trunk/teraterm/ttpset/ttset.c	2012-06-09 16:01:25 UTC (rev 4963)
@@ -2918,8 +2918,8 @@
 void FAR PASCAL CopySerialList(PCHAR IniSrc, PCHAR IniDest, PCHAR section,
                                PCHAR key, int MaxList)
 {
-	int i;
-	char EntName[10];
+	int i, j;
+	char EntName[10], EntName2[10];
 	char TempHost[HostNameMaxLength + 1];
 
 	if (_stricmp(IniSrc, IniDest) == 0)
@@ -2927,19 +2927,22 @@
 
 	WritePrivateProfileString(section, NULL, NULL, IniDest);
 
-	i = 1;
+	i = j = 1;
 	do {
 		_snprintf_s(EntName, sizeof(EntName), _TRUNCATE, "%s%i", key, i);
+		_snprintf_s(EntName2, sizeof(EntName2), _TRUNCATE, "%s%i", key, j);
 
 		/* Get one hostname from file IniSrc */
 		GetPrivateProfileString(section, EntName, "",
 		                        TempHost, sizeof(TempHost), IniSrc);
 		/* Copy it to the file IniDest */
-		if (strlen(TempHost) > 0)
-			WritePrivateProfileString(section, EntName, TempHost, IniDest);
+		if (strlen(TempHost) > 0) {
+			WritePrivateProfileString(section, EntName2, TempHost, IniDest);
+			j++;
+		}
 		i++;
 	}
-	while ((i <= MaxList) && (strlen(TempHost) > 0));
+	while (i <= MaxList);
 
 	/* update file */
 	WritePrivateProfileString(NULL, NULL, NULL, IniDest);
@@ -2977,10 +2980,11 @@
 				if (i == 1)
 					Update = FALSE;
 			}
-			else
+			else if (Len > 0) {
 				j = j + Len + 1;
+			}
 			i++;
-		} while ((i <= MaxList) && (Len != 0) && Update);
+		} while ((i <= MaxList) && Update);
 
 		if (Update) {
 			WritePrivateProfileString(section, NULL, NULL, FName);

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2012-06-08 13:20:26 UTC (rev 4962)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2012-06-09 16:01:25 UTC (rev 4963)
@@ -1159,7 +1159,7 @@
 				SendDlgItemMessage(dlg, IDC_HOSTNAME, CB_ADDSTRING,
 				                   0, (LPARAM) TempHost);
 			i++;
-		} while ((i <= MAXHOSTLIST) && (strlen(TempHost) > 0));
+		} while (i <= MAXHOSTLIST);
 
 		SendDlgItemMessage(dlg, IDC_HOSTNAME, EM_LIMITTEXT,
 		                   HostNameMaxLength - 1, 0);



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