OSDN Git Service

Modify documents.
[ffftp/ffftp.git] / ftpproc.c
index 8639482..e13bc7d 100644 (file)
--- a/ftpproc.c
+++ b/ftpproc.c
@@ -71,7 +71,7 @@ static INT_PTR CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wP
 static INT_PTR CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt);\r
 static int AskMirrorNoTrn(char *Fname, int Mode);\r
-static int AskUpLoadFileAttr(char *Fname);\r
+static int AskUploadFileAttr(char *Fname);\r
 // 64ビット対応\r
 //static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static INT_PTR CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
@@ -140,14 +140,13 @@ static double FileSize;           /* ファイル総容量 */
 \r
 // ディレクトリ自動作成\r
 // ローカル側のパスから必要なフォルダを作成\r
-int MakeDirFromLocalPath(char* LocalFile)\r
+int MakeDirFromLocalPath(char* LocalFile, char* Old)\r
 {\r
        TRANSPACKET Pkt;\r
        char* pDelimiter;\r
        char* pNext;\r
        char* Cat;\r
        int Len;\r
-       char Tmp[FMAX_PATH+1];\r
        int Make;\r
        pDelimiter = LocalFile;\r
        Make = NO;\r
@@ -156,9 +155,7 @@ int MakeDirFromLocalPath(char* LocalFile)
                Len = pNext - LocalFile;\r
                strncpy(Pkt.LocalFile, LocalFile, Len);\r
                Pkt.LocalFile[Len] = '\0';\r
-               AskLocalCurDir(Tmp, FMAX_PATH);\r
-               SetYenTail(Tmp);\r
-               if(strncmp(LocalFile, Tmp, Len + 1) != 0)\r
+               if(strncmp(LocalFile, Old, Len + 1) != 0)\r
                {\r
                        Cat = Pkt.LocalFile + (pDelimiter - LocalFile);\r
                        if(FnameCnv == FNAME_LOWER)\r
@@ -178,11 +175,13 @@ int MakeDirFromLocalPath(char* LocalFile)
        return Make;\r
 }\r
 \r
-void DownLoadProc(int ChName, int ForceFile, int All)\r
+void DownloadProc(int ChName, int ForceFile, int All)\r
 {\r
        FILELIST *FileListBase;\r
        FILELIST *Pos;\r
        TRANSPACKET Pkt;\r
+       // ディレクトリ自動作成\r
+       char Tmp[FMAX_PATH+1];\r
 \r
        // 同時接続対応\r
        CancelFlg = NO;\r
@@ -286,6 +285,8 @@ void DownLoadProc(int ChName, int ForceFile, int All)
                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
                                Pkt.KanaCnv = AskHostKanaCnv();\r
 \r
+                               // ディレクトリ自動作成\r
+                               strcpy(Tmp, Pkt.LocalFile);\r
                                Pkt.Mode = CheckLocalFile(&Pkt);        /* Pkt.ExistSize がセットされる */\r
                                if(Pkt.Mode == EXIST_ABORT)\r
                                        break;\r
@@ -294,7 +295,7 @@ void DownLoadProc(int ChName, int ForceFile, int All)
 //                                     AddTransFileList(&Pkt);\r
                                {\r
                                        if(MakeAllDir == YES)\r
-                                               MakeDirFromLocalPath(Pkt.LocalFile);\r
+                                               MakeDirFromLocalPath(Pkt.LocalFile, Tmp);\r
                                        AddTransFileList(&Pkt);\r
                                }\r
                        }\r
@@ -331,7 +332,7 @@ void DownLoadProc(int ChName, int ForceFile, int All)
 *              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-void DirectDownLoadProc(char *Fname)\r
+void DirectDownloadProc(char *Fname)\r
 {\r
        TRANSPACKET Pkt;\r
 \r
@@ -434,7 +435,7 @@ void DirectDownLoadProc(char *Fname)
 *              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-void InputDownLoadProc(void)\r
+void InputDownloadProc(void)\r
 {\r
        char Path[FMAX_PATH+1];\r
        int Tmp;\r
@@ -444,7 +445,7 @@ void InputDownLoadProc(void)
        strcpy(Path, "");\r
        if(InputDialogBox(downname_dlg, GetMainHwnd(), NULL, Path, FMAX_PATH, &Tmp, IDH_HELP_TOPIC_0000001) == YES)\r
        {\r
-               DirectDownLoadProc(Path);\r
+               DirectDownloadProc(Path);\r
        }\r
 \r
 //     EnableUserOpe();\r
@@ -940,7 +941,7 @@ static INT_PTR CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM
 \r
 // ディレクトリ自動作成\r
 // リモート側のパスから必要なディレクトリを作成\r
-int MakeDirFromRemotePath(char* RemoteFile, int FirstAdd)\r
+int MakeDirFromRemotePath(char* RemoteFile, char* Old, int FirstAdd)\r
 {\r
        TRANSPACKET Pkt;\r
        TRANSPACKET Pkt1;\r
@@ -948,7 +949,6 @@ int MakeDirFromRemotePath(char* RemoteFile, int FirstAdd)
        char* pNext;\r
        char* Cat;\r
        int Len;\r
-       char Tmp[FMAX_PATH+1];\r
        int Make;\r
        pDelimiter = RemoteFile;\r
        Make = NO;\r
@@ -957,9 +957,7 @@ int MakeDirFromRemotePath(char* RemoteFile, int FirstAdd)
                Len = pNext - RemoteFile;\r
                strncpy(Pkt.RemoteFile, RemoteFile, Len);\r
                Pkt.RemoteFile[Len] = '\0';\r
-               AskRemoteCurDir(Tmp, FMAX_PATH);\r
-               SetSlashTail(Tmp);\r
-               if(strncmp(RemoteFile, Tmp, Len + 1) != 0)\r
+               if(strncmp(RemoteFile, Old, Len + 1) != 0)\r
                {\r
                        Cat = Pkt.RemoteFile + (pDelimiter - RemoteFile);\r
                        if(FnameCnv == FNAME_LOWER)\r
@@ -1004,7 +1002,7 @@ int MakeDirFromRemotePath(char* RemoteFile, int FirstAdd)
        return Make;\r
 }\r
 \r
-void UpLoadListProc(int ChName, int All)\r
+void UploadListProc(int ChName, int All)\r
 {\r
        FILELIST *FileListBase;\r
        FILELIST *Pos;\r
@@ -1143,7 +1141,7 @@ void UpLoadListProc(int ChName, int All)
                                Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
                                Pkt.Size = 0;\r
                                Pkt.Time = Pos->Time;\r
-                               Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
+                               Pkt.Attr = AskUploadFileAttr(Pkt.RemoteFile);\r
                                Pkt.KanjiCode = AskHostKanjiCode();\r
                                // UTF-8対応\r
                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
@@ -1153,6 +1151,8 @@ void UpLoadListProc(int ChName, int All)
                                        CalcExtentSize(&Pkt, Pos->Size);\r
                                }\r
 #endif\r
+                               // ディレクトリ自動作成\r
+                               strcpy(Tmp, Pkt.RemoteFile);\r
                                Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
                                if(Pkt.Mode == EXIST_ABORT)\r
                                        break;\r
@@ -1161,7 +1161,7 @@ void UpLoadListProc(int ChName, int All)
                                        // ディレクトリ自動作成\r
                                        if(MakeAllDir == YES)\r
                                        {\r
-                                               if(MakeDirFromRemotePath(Pkt.RemoteFile, FirstAdd) == YES)\r
+                                               if(MakeDirFromRemotePath(Pkt.RemoteFile, Tmp, FirstAdd) == YES)\r
                                                        FirstAdd = NO;\r
                                        }\r
                                        if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
@@ -1210,7 +1210,7 @@ void UpLoadListProc(int ChName, int All)
 *              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-void UpLoadDragProc(WPARAM wParam)\r
+void UploadDragProc(WPARAM wParam)\r
 {\r
        FILELIST *FileListBase;\r
        FILELIST *Pos;\r
@@ -1316,7 +1316,7 @@ void UpLoadDragProc(WPARAM wParam)
                                Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
                                Pkt.Size = 0;\r
                                Pkt.Time = Pos->Time;\r
-                               Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
+                               Pkt.Attr = AskUploadFileAttr(Pkt.RemoteFile);\r
                                Pkt.KanjiCode = AskHostKanjiCode();\r
                                // UTF-8対応\r
                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
@@ -1327,6 +1327,8 @@ void UpLoadDragProc(WPARAM wParam)
                                        CalcExtentSize(&Pkt, Pos->Size);\r
                                }\r
 #endif\r
+                               // ディレクトリ自動作成\r
+                               strcpy(Tmp, Pkt.RemoteFile);\r
                                Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
                                if(Pkt.Mode == EXIST_ABORT)\r
                                        break;\r
@@ -1335,7 +1337,7 @@ void UpLoadDragProc(WPARAM wParam)
                                        // ディレクトリ自動作成\r
                                        if(MakeAllDir == YES)\r
                                        {\r
-                                               if(MakeDirFromRemotePath(Pkt.RemoteFile, FirstAdd) == YES)\r
+                                               if(MakeDirFromRemotePath(Pkt.RemoteFile, Tmp, FirstAdd) == YES)\r
                                                        FirstAdd = NO;\r
                                        }\r
                                        if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
@@ -1600,7 +1602,7 @@ void MirrorUploadProc(int Notify)
                                                Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
                                                Pkt.Size = 0;\r
                                                Pkt.Time = LocalPos->Time;\r
-                                               Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
+                                               Pkt.Attr = AskUploadFileAttr(Pkt.RemoteFile);\r
                                                Pkt.KanjiCode = AskHostKanjiCode();\r
                                                // UTF-8対応\r
                                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
@@ -1973,7 +1975,7 @@ static int AskMirrorNoTrn(char *Fname, int Mode)
 *              int 属性 (-1=設定なし)\r
 *----------------------------------------------------------------------------*/\r
 \r
-static int AskUpLoadFileAttr(char *Fname)\r
+static int AskUploadFileAttr(char *Fname)\r
 {\r
        int Ret;\r
        int Sts;\r