OSDN Git Service

Compile executable files.
[ffftp/ffftp.git] / registry.c
index 825501f..f51900a 100644 (file)
@@ -193,6 +193,8 @@ extern int FolderAttrNum;
 // 暗号化通信対応\r
 extern BYTE CertificateCacheHash[MAX_CERT_CACHE_HASH][20];\r
 extern BYTE SSLRootCAFileHash[20];\r
+// ファイルアイコン表示対応\r
+extern int DispFileIcon;\r
 \r
 /*----- マスタパスワードの設定 ----------------------------------------------\r
 *\r
@@ -422,7 +424,10 @@ void SaveRegistory(void)
 \r
                                WriteMultiStringToReg(hKey4, "DefAttr", DefAttrList);\r
 \r
-                               GetTempPath(FMAX_PATH, Str);\r
+                               // 環境依存の不具合対策\r
+//                             GetTempPath(FMAX_PATH, Str);\r
+                               GetAppTempPath(Str);\r
+                               SetYenTail(Str);\r
                                SaveStr(hKey4, "Tmp", TmpPath, Str);\r
 \r
                                WriteBinaryToReg(hKey4, "Hdlg", &HostDlgSize, sizeof(SIZE));\r
@@ -608,6 +613,8 @@ void SaveRegistory(void)
                                StrCatOut((char*)&SSLRootCAFileHash, sizeof(SSLRootCAFileHash), Buf);\r
                                EncodePassword(Buf, Str);\r
                                WriteStringToReg(hKey4, "RootCertHash", Str);\r
+                               // ファイルアイコン表示対応\r
+                               WriteIntValueToReg(hKey4, "ListIcon", DispFileIcon);\r
                        }\r
                        CloseSubKey(hKey4);\r
                }\r
@@ -977,6 +984,8 @@ int LoadRegistory(void)
                        ReadStringFromReg(hKey4, "RootCertHash", Str, PRIVATE_KEY_LEN*4+1);\r
                        DecodePassword(Str, Buf);\r
                        StrReadIn(Buf, sizeof(SSLRootCAFileHash), (char*)&SSLRootCAFileHash);\r
+                       // ファイルアイコン表示対応\r
+                       ReadIntValueFromReg(hKey4, "ListIcon", &DispFileIcon);\r
 \r
                        CloseSubKey(hKey4);\r
                }\r
@@ -2490,9 +2499,10 @@ static int ReadMultiStringFromReg(void *Handle, char *Name, char *Str, DWORD Siz
                        switch(IniKanjiCode)\r
                        {\r
                        case KANJI_NOCNV:\r
-                               TempSize = min1(Size-1, strlen(Pos));\r
+                               TempSize = min1(Size - 2, strlen(Pos));\r
                                TempSize = StrReadIn(Pos, TempSize, Str);\r
                                *(Str + TempSize) = NUL;\r
+                               *(Str + TempSize + 1) = NUL;\r
                                Sts = FFFTP_SUCCESS;\r
                                if(!CheckMultiStringM(Str))\r
                                        break;\r