From: s_kawamoto Date: Thu, 10 Nov 2011 10:48:20 +0000 (+0900) Subject: Change to encode reply messages with Kanji code of filenames. X-Git-Url: http://git.sourceforge.jp/view?p=ffftp%2Fffftp.git;a=commitdiff_plain;h=594d1b1617d71ba34e3ea57478a47f34a547fb2e Change to encode reply messages with Kanji code of filenames. Change URL strings. Fix bugs of UTF-8 to UTF-16 API bridge. Fix bugs of opening wrong files when they contain no extensions. --- diff --git a/FFFTP.vc90.vcproj b/FFFTP.vc90.vcproj index 7f15584..ee88d31 100644 --- a/FFFTP.vc90.vcproj +++ b/FFFTP.vc90.vcproj @@ -170,7 +170,7 @@ LinkIncremental="1" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" ProgramDatabaseFile=".\Release\FFFTP.pdb" SubSystem="2" RandomizedBaseAddress="1" diff --git a/FFFTP.vcproj b/FFFTP.vcproj index eb93458..37a7451 100644 --- a/FFFTP.vcproj +++ b/FFFTP.vcproj @@ -76,7 +76,7 @@ LinkIncremental="2" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug\FFFTP.pdb" SubSystem="2" @@ -170,7 +170,7 @@ LinkIncremental="1" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" ProgramDatabaseFile=".\Release\FFFTP.pdb" SubSystem="2" /> diff --git a/FFFTP_Eng_Release/FFFTP.exe b/FFFTP_Eng_Release/FFFTP.exe index 947983e..b2d470d 100644 Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ diff --git a/FFFTP_English.vc90.vcproj b/FFFTP_English.vc90.vcproj index 03ed55d..986d873 100644 --- a/FFFTP_English.vc90.vcproj +++ b/FFFTP_English.vc90.vcproj @@ -78,7 +78,7 @@ LinkIncremental="2" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" GenerateDebugInformation="true" ProgramDatabaseFile=".\FFFTP_Eng_Debug\FFFTP.pdb" SubSystem="2" @@ -170,7 +170,7 @@ LinkIncremental="1" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" ProgramDatabaseFile=".\FFFTP_Eng_Release\FFFTP.pdb" SubSystem="2" RandomizedBaseAddress="1" diff --git a/FFFTP_English.vcproj b/FFFTP_English.vcproj index 5919e3a..c0ed41b 100644 --- a/FFFTP_English.vcproj +++ b/FFFTP_English.vcproj @@ -77,7 +77,7 @@ LinkIncremental="2" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" GenerateDebugInformation="true" ProgramDatabaseFile=".\FFFTP_Eng_Debug\FFFTP.pdb" SubSystem="2" @@ -170,7 +170,7 @@ LinkIncremental="1" SuppressStartupBanner="true" GenerateManifest="false" - DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;sfc.dll;shell32.dll;ole32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" + DelayLoadDLLs="advapi32.dll;comctl32.dll;crypt32.dll;comdlg32.dll;gdi32.dll;ole32.dll;sfc.dll;shell32.dll;user32.dll;winmm.dll;wintrust.dll;wsock32.dll" ProgramDatabaseFile=".\FFFTP_Eng_Release\FFFTP.pdb" SubSystem="2" /> diff --git a/Release/FFFTP.exe b/Release/FFFTP.exe index b7f916a..16eddc6 100644 Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ diff --git a/common.h b/common.h index 4e7c758..c078703 100644 --- a/common.h +++ b/common.h @@ -75,7 +75,9 @@ #define PROGRAM_VERSION_NUM 1990 /* バージョン */ -#define MYWEB_URL "http://www2.biglobe.ne.jp/~sota/ffftp-qa.html" +// SourceForge.JPによるフォーク +//#define MYWEB_URL "http://www2.biglobe.ne.jp/~sota/ffftp-qa.html" +#define MYWEB_URL "http://sourceforge.jp/projects/ffftp/" diff --git a/local.c b/local.c index 3988c6d..dfc0435 100644 --- a/local.c +++ b/local.c @@ -181,13 +181,20 @@ void DoLocalRENAME(char *Src, char *Dst) void DispFileProperty(char *Fname) { SHELLEXECUTEINFO sInfo; + // 異なるファイルが表示されるバグ修正 + // 詳細は不明だが末尾に半角スペースを置くと拡張子の補完がされなくなる + char Fname2[FMAX_PATH+1]; memset(&sInfo, NUL, sizeof(SHELLEXECUTEINFO)); sInfo.cbSize = sizeof(SHELLEXECUTEINFO); sInfo.fMask = SEE_MASK_INVOKEIDLIST; sInfo.hwnd = NULL; //GetMainHwnd(); sInfo.lpVerb = "Properties"; - sInfo.lpFile = Fname; + // 異なるファイルが表示されるバグ修正 +// sInfo.lpFile = Fname; + strcpy(Fname2, Fname); + strcat(Fname2, " "); + sInfo.lpFile = Fname2; sInfo.lpParameters = NULL; sInfo.lpDirectory = NULL; sInfo.nShow = SW_NORMAL; diff --git a/main.c b/main.c index bcde07a..25b623a 100644 --- a/main.c +++ b/main.c @@ -1230,7 +1230,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA break; case MENU_HELP_TROUBLE : - ShellExecute(NULL, "open", MYWEB_URL, NULL, ".", SW_SHOW); + // 任意のコードが実行されるバグ修正 +// ShellExecute(NULL, "open", MYWEB_URL, NULL, ".", SW_SHOW); + ShellExecute(NULL, "open", MYWEB_URL, NULL, NULL, SW_SHOW); break; case MENU_BMARK_ADD : @@ -2473,7 +2475,10 @@ void ExecViewer(char *Fname, int App) AskLocalCurDir(CurDir, FMAX_PATH); - if((App == -1) && (FindExecutable(Fname, NULL, AssocProg) > (HINSTANCE)32)) + // 任意のコードが実行されるバグ修正 + // 拡張子が無いと補完されるため +// if((App == -1) && (FindExecutable(Fname, NULL, AssocProg) > (HINSTANCE)32)) + if((App == -1) && strrchr(Fname, '.') > strrchr(Fname, '\\') && (FindExecutable(Fname, NULL, AssocProg) > (HINSTANCE)32)) { DoPrintf("ShellExecute - %s", Fname); ShellExecute(NULL, "open", Fname, NULL, CurDir, SW_SHOW); diff --git a/mbswrapper.c b/mbswrapper.c index 242837c..28c9a2c 100644 --- a/mbswrapper.c +++ b/mbswrapper.c @@ -1718,6 +1718,51 @@ END_ROUTINE return r; } +BOOL ShellExecuteExM(LPSHELLEXECUTEINFOA lpExecInfo) +{ + BOOL r = FALSE; + wchar_t* pw0 = NULL; + wchar_t* pw1 = NULL; + wchar_t* pw2 = NULL; + wchar_t* pw3 = NULL; + wchar_t* pw4 = NULL; + SHELLEXECUTEINFOW wExecInfo; +START_ROUTINE + wExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW); + wExecInfo.fMask = lpExecInfo->fMask; + wExecInfo.hwnd = lpExecInfo->hwnd; + pw0 = DuplicateMtoW(lpExecInfo->lpVerb, -1); + wExecInfo.lpVerb = pw0; + pw1 = DuplicateMtoW(lpExecInfo->lpFile, -1); + wExecInfo.lpFile = pw1; + pw2 = DuplicateMtoW(lpExecInfo->lpParameters, -1); + wExecInfo.lpParameters = pw2; + pw3 = DuplicateMtoW(lpExecInfo->lpDirectory, -1); + wExecInfo.lpDirectory = pw3; + wExecInfo.nShow = lpExecInfo->nShow; + wExecInfo.hInstApp = lpExecInfo->hInstApp; + wExecInfo.lpIDList = lpExecInfo->lpIDList; + if(lpExecInfo->fMask & SEE_MASK_CLASSNAME) + { + pw4 = DuplicateMtoW(lpExecInfo->lpClass, -1); + wExecInfo.lpClass = pw4; + } + wExecInfo.hkeyClass = lpExecInfo->hkeyClass; + wExecInfo.dwHotKey = lpExecInfo->dwHotKey; + wExecInfo.hIcon = lpExecInfo->hIcon; + wExecInfo.hProcess = lpExecInfo->hProcess; + r = ShellExecuteExW(&wExecInfo); + lpExecInfo->hInstApp = wExecInfo.hInstApp; + lpExecInfo->hProcess = wExecInfo.hProcess; +END_ROUTINE + FreeDuplicatedString(pw0); + FreeDuplicatedString(pw1); + FreeDuplicatedString(pw2); + FreeDuplicatedString(pw3); + FreeDuplicatedString(pw4); + return r; +} + PIDLIST_ABSOLUTE SHBrowseForFolderM(LPBROWSEINFOA lpbi) { PIDLIST_ABSOLUTE r = NULL; diff --git a/mbswrapper.h b/mbswrapper.h index 6e5e6ce..08a0f00 100644 --- a/mbswrapper.h +++ b/mbswrapper.h @@ -125,6 +125,9 @@ HINSTANCE FindExecutableM(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult); #undef ShellExecute #define ShellExecute ShellExecuteM HINSTANCE ShellExecuteM(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd); +#undef ShellExecuteEx +#define ShellExecuteEx ShellExecuteExM +BOOL ShellExecuteExM(LPSHELLEXECUTEINFOA lpExecInfo); #undef SHBrowseForFolder #define SHBrowseForFolder SHBrowseForFolderM PIDLIST_ABSOLUTE SHBrowseForFolderM(LPBROWSEINFOA lpbi); diff --git a/mesg-eng.h b/mesg-eng.h index 24eacb5..0d91977 100644 --- a/mesg-eng.h +++ b/mesg-eng.h @@ -281,7 +281,7 @@ #define MSGJPN281 "Can't connect with PASV mode" #define MSGJPN282 "INI filename is not specified" #define MSGJPN283 "INI file : " -#define MSGJPN284 "http://www2.biglobe.ne.jp/~sota/" +#define MSGJPN284 "http://sourceforge.jp/projects/ffftp/" #define MSGJPN285 "Failed to execute Registory Editor." #define MSGJPN286 "Save Settings" #define MSGJPN287 "Reg file\0*.reg\0All file\0*\0" diff --git a/mesg-eng.old.h b/mesg-eng.old.h index 86bbb4f..599963f 100644 --- a/mesg-eng.old.h +++ b/mesg-eng.old.h @@ -281,7 +281,7 @@ #define MSGJPN281 "Can't connect with PASV mode" #define MSGJPN282 "INI filename is not specified" #define MSGJPN283 "INI file : " -#define MSGJPN284 "http://www2.biglobe.ne.jp/~sota/" +#define MSGJPN284 "http://sourceforge.jp/projects/ffftp/" #define MSGJPN285 "Failed to execute Registory Editor." #define MSGJPN286 "Save Settings" #define MSGJPN287 "Reg file\0*.reg\0All file\0*\0" diff --git a/mesg-jpn.h b/mesg-jpn.h index 6e0bef2..a6e6624 100644 --- a/mesg-jpn.h +++ b/mesg-jpn.h @@ -281,7 +281,7 @@ #define MSGJPN281 "PASV\xE3\x83\xA2\xE3\x83\xBC\xE3\x83\x89\xE3\x81\xA7\xE6\x8E\xA5\xE7\xB6\x9A\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93" #define MSGJPN282 "INI\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\xE5\x90\x8D\xE3\x81\x8C\xE6\x8C\x87\xE5\xAE\x9A\xE3\x81\x95\xE3\x82\x8C\xE3\x81\xA6\xE3\x81\x84\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93" #define MSGJPN283 "INI\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\xE6\x8C\x87\xE5\xAE\x9A\xEF\xBC\x9A" -#define MSGJPN284 "http://www2.biglobe.ne.jp/~sota/" +#define MSGJPN284 "http://sourceforge.jp/projects/ffftp/" #define MSGJPN285 "\xE3\x83\xAC\xE3\x82\xB8\xE3\x82\xB9\xE3\x83\x88\xE3\x83\xAA\xE3\x82\xA8\xE3\x83\x87\xE3\x82\xA3\xE3\x82\xBF\xE3\x81\x8C\xE8\xB5\xB7\xE5\x8B\x95\xE3\x81\xA7\xE3\x81\x8D\xE3\x81\xBE\xE3\x81\x9B\xE3\x82\x93\xE3\x81\xA7\xE3\x81\x97\xE3\x81\x9F" #define MSGJPN286 "\xE8\xA8\xAD\xE5\xAE\x9A\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\xE3\x81\xAE\xE4\xBF\x9D\xE5\xAD\x98" #define MSGJPN287 "Reg\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\0*.reg\0\xE5\x85\xA8\xE3\x81\xA6\xE3\x81\xAE\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB\0*\0" diff --git a/mesg-jpn.old.h b/mesg-jpn.old.h index c73e228..6c06669 100644 --- a/mesg-jpn.old.h +++ b/mesg-jpn.old.h @@ -281,7 +281,7 @@ #define MSGJPN281 "PASVƒ‚[ƒh‚Őڑ±‚Å‚«‚Ü‚¹‚ñ" #define MSGJPN282 "INIƒtƒ@ƒCƒ‹–¼‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ" #define MSGJPN283 "INIƒtƒ@ƒCƒ‹Žw’èF" -#define MSGJPN284 "http://www2.biglobe.ne.jp/~sota/" +#define MSGJPN284 "http://sourceforge.jp/projects/ffftp/" #define MSGJPN285 "ƒŒƒWƒXƒgƒŠƒGƒfƒBƒ^‚ª‹N“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½" #define MSGJPN286 "Ý’èƒtƒ@ƒCƒ‹‚Ì•Û‘¶" #define MSGJPN287 "Regƒtƒ@ƒCƒ‹\0*.reg\0‘S‚Ẵtƒ@ƒCƒ‹\0*\0" diff --git a/registry.c b/registry.c index 1bb3b8b..7226885 100644 --- a/registry.c +++ b/registry.c @@ -1104,7 +1104,7 @@ void SaveSettingsToFile(void) { if(SetCurrentDirectory(SysDir)) { - if(ShellExecute(NULL, "open", "regedit", Tmp, ".", SW_SHOW) <= (HINSTANCE)32) + if(ShellExecute(NULL, "open", "regedit", Tmp, NULL, SW_SHOW) <= (HINSTANCE)32) { MessageBox(NULL, MSGJPN285, "FFFTP", MB_OK); } @@ -1168,7 +1168,7 @@ int LoadSettingsFromFile(void) { if(SetCurrentDirectory(SysDir)) { - if(ShellExecute(NULL, "open", "regedit", Tmp, ".", SW_SHOW) <= (HINSTANCE)32) + if(ShellExecute(NULL, "open", "regedit", Tmp, NULL, SW_SHOW) <= (HINSTANCE)32) { MessageBox(NULL, MSGJPN285, "FFFTP", MB_OK); } diff --git a/remote.c b/remote.c index 0613fcb..b2fffd6 100644 --- a/remote.c +++ b/remote.c @@ -239,12 +239,8 @@ static int DoPWD(char *Buf) if(strlen(Tmp) < FMAX_PATH) { strcpy(Buf, Tmp); - // 0x5Cが含まれる文字列を扱えないバグ修正 -// ReplaceAll(Buf, '\\', '/'); - ChangeSepaRemote2Local(Buf); - ChangeFnameRemote2Local(Buf, FMAX_PATH); - // 0x5Cが含まれる文字列を扱えないバグ修正 ReplaceAll(Buf, '\\', '/'); + ChangeSepaRemote2Local(Buf); } else Sts = FTP_ERROR*100; @@ -905,6 +901,8 @@ int ReadReplyMessage(SOCKET cSkt, char *Buf, int Max, int *CancelCheckWork, char iContinue = NO; iRetCode = ReadOneLine(cSkt, Tmp, ONELINE_BUF_SIZE, CancelCheckWork); + // 文字化け対策 + ChangeFnameRemote2Local(Tmp, ONELINE_BUF_SIZE); SetTaskMsg("%s", Tmp); if(Buf != NULL) diff --git a/updatebell.c b/updatebell.c index c300b77..2507303 100644 --- a/updatebell.c +++ b/updatebell.c @@ -40,10 +40,17 @@ +// SourceForge.JPによるフォーク +//#define MAIL_ADDRESS "sota@mwa.biglobe.ne.jp" +//#define SOFTWARE "FFFTP" +//#define MYNAME "曽田" +//#define MYURL "http://www2.biglobe.ne.jp/~sota/" +//#define INFOFILE "http://www2.biglobe.ne.jp/~sota/product/update.inf" +// TODO: 更新の通知用のINFファイルのURL(SourceForge.JPに作成可能かどうか不明) #define MAIL_ADDRESS "sota@mwa.biglobe.ne.jp" #define SOFTWARE "FFFTP" -#define MYNAME "曽田" -#define MYURL "http://www2.biglobe.ne.jp/~sota/" +#define MYNAME "FFFTP Project" +#define MYURL "http://sourceforge.jp/projects/ffftp/" #define INFOFILE "http://www2.biglobe.ne.jp/~sota/product/update.inf"