• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FFFTPのソースコードです。


Commit MetaInfo

Revisão08cb92f946f548cab1ed9738b6bdda9e65247935 (tree)
Hora2011-12-04 01:21:09
Autors_kawamoto <s_kawamoto@user...>
Commiters_kawamoto

Mensagem de Log

Fix bugs of UTF-8 to UTF-16 API bridge.
Change the temporary directory.

Mudança Sumário

Diff

Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
--- a/common.h
+++ b/common.h
@@ -1730,6 +1730,8 @@ LONGLONG MakeLongLong(DWORD High, DWORD Low);
17301730 char *MakeNumString(LONGLONG Num, char *Buf, BOOL Comma);
17311731 // 異なるファイルが表示されるバグ修正
17321732 char* MakeDistinguishableFileName(char* Out, char* In);
1733+// 環境依存の不具合対策
1734+char* GetAppTempPath(char* Buf);
17331735
17341736 /*===== dlgsize.c =====*/
17351737
--- a/filelist.c
+++ b/filelist.c
@@ -462,10 +462,15 @@ static void doTransferRemoteFile(void)
462462
463463 // アプリを多重起動してもコンフリクトしないように、テンポラリフォルダ名にプロセスID
464464 // を付加する。(2007.9.13 yutaka)
465- GetTempPath(sizeof(TmpDir), TmpDir);
466- pid = GetCurrentProcessId();
467- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "ffftp%d", pid);
468- strncat_s(TmpDir, sizeof(TmpDir), buf, _TRUNCATE);
465+ // 環境依存の不具合対策
466+// GetTempPath(sizeof(TmpDir), TmpDir);
467+// pid = GetCurrentProcessId();
468+// _snprintf_s(buf, sizeof(buf), _TRUNCATE, "ffftp%d", pid);
469+// strncat_s(TmpDir, sizeof(TmpDir), buf, _TRUNCATE);
470+ GetAppTempPath(TmpDir);
471+ _mkdir(TmpDir);
472+ SetYenTail(TmpDir);
473+ strcat(TmpDir, "transfer");
469474 _mkdir(TmpDir);
470475 #if 0
471476 if (TmpDir[strlen(TmpDir) - 1] == '\\') {
--- a/main.c
+++ b/main.c
@@ -415,7 +415,11 @@ static int InitApp(LPSTR lpszCmdLine, int cmdShow)
415415 {
416416 Accel = LoadAccelerators(hInstFtp, MAKEINTRESOURCE(ffftp_accel));
417417
418- GetTempPath(FMAX_PATH, TmpPath);
418+ // 環境依存の不具合対策
419+// GetTempPath(FMAX_PATH, TmpPath);
420+ GetAppTempPath(TmpPath);
421+ _mkdir(TmpPath);
422+ SetYenTail(TmpPath);
419423
420424 GetModuleFileName(NULL, HelpPath, FMAX_PATH);
421425 strcpy(GetFileName(HelpPath), "ffftp.chm");
@@ -2019,6 +2023,9 @@ static char *GetToken(char *Str, char *Buf)
20192023
20202024 static void ExitProc(HWND hWnd)
20212025 {
2026+ // 環境依存の不具合対策
2027+ char Tmp[FMAX_PATH+1];
2028+
20222029 CancelFlg = YES;
20232030
20242031 CloseTransferThread();
@@ -2047,6 +2054,10 @@ static void ExitProc(HWND hWnd)
20472054 else
20482055 DeleteCache();
20492056
2057+ // 環境依存の不具合対策
2058+ GetAppTempPath(Tmp);
2059+ _rmdir(Tmp);
2060+
20502061 if(RasClose == YES)
20512062 {
20522063 DisconnectRas(RasCloseNotify);
--- a/mbswrapper.c
+++ b/mbswrapper.c
@@ -2109,7 +2109,7 @@ END_ROUTINE
21092109
21102110 int mkdirM(const char * _Path)
21112111 {
2112- int r = 0;
2112+ int r = -1;
21132113 wchar_t* pw0 = NULL;
21142114 START_ROUTINE
21152115 pw0 = DuplicateMtoW(_Path, -1);
@@ -2121,7 +2121,7 @@ END_ROUTINE
21212121
21222122 int _mkdirM(const char * _Path)
21232123 {
2124- int r = 0;
2124+ int r = -1;
21252125 wchar_t* pw0 = NULL;
21262126 START_ROUTINE
21272127 pw0 = DuplicateMtoW(_Path, -1);
@@ -2133,7 +2133,7 @@ END_ROUTINE
21332133
21342134 int rmdirM(const char * _Path)
21352135 {
2136- int r = 0;
2136+ int r = -1;
21372137 wchar_t* pw0 = NULL;
21382138 START_ROUTINE
21392139 pw0 = DuplicateMtoW(_Path, -1);
@@ -2145,7 +2145,7 @@ END_ROUTINE
21452145
21462146 int _rmdirM(const char * _Path)
21472147 {
2148- int r = 0;
2148+ int r = -1;
21492149 wchar_t* pw0 = NULL;
21502150 START_ROUTINE
21512151 pw0 = DuplicateMtoW(_Path, -1);
@@ -2155,6 +2155,42 @@ END_ROUTINE
21552155 return r;
21562156 }
21572157
2158+int removeM(const char * _Filename)
2159+{
2160+ int r = -1;
2161+ wchar_t* pw0 = NULL;
2162+START_ROUTINE
2163+ pw0 = DuplicateMtoW(_Filename, -1);
2164+ r = _wremove(pw0);
2165+END_ROUTINE
2166+ FreeDuplicatedString(pw0);
2167+ return r;
2168+}
2169+
2170+int _removeM(const char * _Filename)
2171+{
2172+ int r = -1;
2173+ wchar_t* pw0 = NULL;
2174+START_ROUTINE
2175+ pw0 = DuplicateMtoW(_Filename, -1);
2176+ r = _wremove(pw0);
2177+END_ROUTINE
2178+ FreeDuplicatedString(pw0);
2179+ return r;
2180+}
2181+
2182+int _unlinkM(const char * _Filename)
2183+{
2184+ int r = -1;
2185+ wchar_t* pw0 = NULL;
2186+START_ROUTINE
2187+ pw0 = DuplicateMtoW(_Filename, -1);
2188+ r = _wunlink(pw0);
2189+END_ROUTINE
2190+ FreeDuplicatedString(pw0);
2191+ return r;
2192+}
2193+
21582194 size_t _mbslenM(const unsigned char * _Str)
21592195 {
21602196 size_t r = 0;
--- a/mbswrapper.h
+++ b/mbswrapper.h
@@ -182,6 +182,15 @@ int rmdirM(const char * _Path);
182182 #undef _rmdir
183183 #define _rmdir _rmdirM
184184 int _rmdirM(const char * _Path);
185+#undef remove
186+#define remove removeM
187+int removeM(const char * _Filename);
188+#undef _remove
189+#define _remove _removeM
190+int _removeM(const char * _Filename);
191+#undef _unlink
192+#define _unlink _unlinkM
193+int _unlinkM(const char * _Filename);
185194 #undef _mbslen
186195 #define _mbslen _mbslenM
187196 size_t _mbslenM(const unsigned char * _Str);
--- a/misc.c
+++ b/misc.c
@@ -1777,3 +1777,14 @@ char* MakeDistinguishableFileName(char* Out, char* In)
17771777 return Out;
17781778 }
17791779
1780+// 環境依存の不具合対策
1781+char* GetAppTempPath(char* Buf)
1782+{
1783+ char Temp[32];
1784+ GetTempPath(MAX_PATH, Buf);
1785+ SetYenTail(Buf);
1786+ sprintf(Temp, "ffftp%08x", GetCurrentProcessId());
1787+ strcat(Buf, Temp);
1788+ return Buf;
1789+}
1790+
--- a/option.c
+++ b/option.c
@@ -1537,7 +1537,10 @@ static INT_PTR CALLBACK MiscSettingProc(HWND hDlg, UINT message, WPARAM wParam,
15371537 break;
15381538
15391539 case MISC_CACHEDIR_DEF :
1540- GetTempPath(FMAX_PATH, Tmp);
1540+ // 環境依存の不具合対策
1541+// GetTempPath(FMAX_PATH, Tmp);
1542+ GetAppTempPath(Tmp);
1543+ SetYenTail(Tmp);
15411544 SendDlgItemMessage(hDlg, MISC_CACHEDIR, WM_SETTEXT, 0, (LPARAM)Tmp);
15421545 break;
15431546 }
--- a/registry.c
+++ b/registry.c
@@ -422,7 +422,10 @@ void SaveRegistory(void)
422422
423423 WriteMultiStringToReg(hKey4, "DefAttr", DefAttrList);
424424
425- GetTempPath(FMAX_PATH, Str);
425+ // 環境依存の不具合対策
426+// GetTempPath(FMAX_PATH, Str);
427+ GetAppTempPath(Str);
428+ SetYenTail(Str);
426429 SaveStr(hKey4, "Tmp", TmpPath, Str);
427430
428431 WriteBinaryToReg(hKey4, "Hdlg", &HostDlgSize, sizeof(SIZE));