OSDN Git Service

Enlarge buffers for replies on transferring files.
[ffftp/ffftp.git] / filelist.c
index f1299c4..94e02ac 100644 (file)
@@ -1,6 +1,6 @@
-/*=============================================================================\r
+/*=============================================================================\r
 *\r
-*                                                              \83t\83@\83C\83\8b\88ê\97\97\r
+*                                                              ファイル一覧\r
 *\r
 ===============================================================================\r
 / Copyright (C) 1997-2007 Sota. All rights reserved.\r
 / THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 /============================================================================*/\r
 \r
-#define _WIN32_WINNT   0x400\r
+// UTF-8対応\r
+//#define _WIN32_WINNT 0x400\r
 \r
 #define        STRICT\r
+// IPv6対応\r
+#include <winsock2.h>\r
 #include <windows.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
@@ -54,7 +57,7 @@
 #include "OleDragDrop.h"\r
 #include "common.h"\r
 \r
-// UTF-8\91Î\89\9e\r
+// UTF-8対応\r
 #undef __MBSWRAPPER_H__\r
 #include "mbswrapper.h"\r
 \r
 #define WM_DRAGOVER            (WM_APP + 102)\r
 \r
 \r
-/*===== \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\83\8a\83X\83g\97p\83X\83g\83\89\83N\83`\83\83 =====*/\r
+/*===== ファイルリストのリスト用ストラクチャ =====*/\r
 \r
 typedef struct {\r
-       FILELIST *Top;                  /* \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª */\r
-       int Files;                              /* \83t\83@\83C\83\8b\82Ì\90\94 */\r
+       FILELIST *Top;                  /* ファイルリストの先頭 */\r
+       int Files;                              /* ファイルの数 */\r
 } FLISTANCHOR;\r
 \r
-/*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
+/*===== プロトタイプ =====*/\r
 \r
 static LRESULT CALLBACK LocalWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);\r
 static LRESULT CALLBACK RemoteWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);\r
@@ -80,8 +83,12 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
 static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LONGLONG Size, int Attr, int Type, int Link, char *Owner, int InfoExist, int Win);\r
 static void EraseDispFileList(FLISTANCHOR *Anchor);\r
 static void DispFileList2View(HWND hWnd, FLISTANCHOR *Anchor);\r
-static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist);\r
-static BOOL CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// ファイルアイコン表示対応\r
+//static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist);\r
+static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist, int ImageId);\r
+// 64ビット対応\r
+//static BOOL CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static void DispListList(FILELIST *Pos, char *Title);\r
 static void MakeRemoteTree1(char *Path, char *Cur, FILELIST **Base, int *CancelCheckWork);\r
 static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelCheckWork);\r
@@ -97,16 +104,20 @@ static int CheckYYMMDDformat(char *Str, char Sym, int Dig3);
 static int CheckYYYYMMDDformat(char *Str, char Sym);\r
 static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size, FILETIME *Time, int *Attr, char *Owner, int *Link, int *InfoExist);\r
 static int FindField(char *Str, char *Buf, int Num, int ToLast);\r
+// MLSD対応\r
+static int FindField2(char *Str, char *Buf, char Separator, int Num, int ToLast);\r
 static void GetMonth(char *Str, WORD *Month, WORD *Day);\r
 static int GetYearMonthDay(char *Str, WORD *Year, WORD *Month, WORD *Day);\r
 static int GetHourAndMinute(char *Str, WORD *Hour, WORD *Minute);\r
 static int GetVMSdate(char *Str, WORD *Year, WORD *Month, WORD *Day);\r
 static int CheckSpecialDirName(char *Fname);\r
 static int AskFilterStr(char *Fname, int Type);\r
-static BOOL CALLBACK FilterWndProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK FilterWndProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK FilterWndProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static int atoi_n(const char *Str, int Len);\r
 \r
-/*===== \8aO\95\94\8eQ\8fÆ =====*/\r
+/*===== 外部参照 =====*/\r
 \r
 extern int SepaWidth;\r
 extern int RemoteWidth;\r
@@ -114,7 +125,7 @@ extern int ListHeight;
 extern char FilterStr[FILTER_EXT_LEN+1];\r
 extern HWND hHelpWin;\r
 \r
-/* \90Ý\92è\92l */\r
+/* 設定値 */\r
 extern int LocalWidth;\r
 extern int LocalTabWidth[4];\r
 extern int RemoteTabWidth[6];\r
@@ -127,7 +138,7 @@ extern int DispIgnoreHide;
 extern int DispDrives;\r
 extern int MoveMode;\r
 \r
-/*===== \83\8d\81[\83J\83\8b\82È\83\8f\81[\83N =====*/\r
+/*===== ローカルなワーク =====*/\r
 \r
 static HWND hWndListLocal = NULL;\r
 static HWND hWndListRemote = NULL;\r
@@ -137,31 +148,31 @@ static WNDPROC RemoteProcPtr;
 \r
 static HIMAGELIST ListImg = NULL;\r
 \r
-static char FindStr[40+1] = { "*" };           /* \8c\9f\8dõ\95\8e\9a\97ñ */\r
+static char FindStr[40+1] = { "*" };           /* 検索文字列 */\r
 static int IgnoreNew = NO;\r
 static int IgnoreOld = NO;\r
 static int IgnoreExist = NO;\r
 \r
 static int Dragging = NO;\r
 \r
-static int StratusMode;                        /* 0=\83t\83@\83C\83\8b, 1=\83f\83B\83\8c\83N\83g\83\8a, 2=\83\8a\83\93\83N */\r
+static int StratusMode;                        /* 0=ファイル, 1=ディレクトリ, 2=リンク */\r
 \r
 \r
-// \83\8a\83\82\81[\83g\83t\83@\83C\83\8b\83\8a\83X\83g (2007.9.3 yutaka)\r
+// リモートファイルリスト (2007.9.3 yutaka)\r
 static FILELIST *remoteFileListBase;\r
 static FILELIST *remoteFileListBaseNoExpand;\r
 static char remoteFileDir[FMAX_PATH + 1];\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\83E\83C\83\93\83h\83E\82ð\8dì\90¬\82·\82é ------------------------------------\r
+/*----- ファイルリストウインドウを作成する ------------------------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \90e\83E\83C\83\93\83h\83E\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              HINSTANCE hInst : \83C\83\93\83X\83^\83\93\83X\83n\83\93\83h\83\8b\r
+*              HWND hWnd : 親ウインドウのウインドウハンドル\r
+*              HINSTANCE hInst : インスタンスハンドル\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      SUCCESS/FAIL\r
+*              int ステータス\r
+*                      FFFTP_SUCCESS/FFFTP_FAIL\r
 *----------------------------------------------------------------------------*/\r
 \r
 int MakeListWin(HWND hWnd, HINSTANCE hInst)\r
@@ -170,7 +181,7 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
        LV_COLUMN LvCol;\r
        long Tmp;\r
 \r
-       /*===== \83\8d\81[\83J\83\8b\91¤\82Ì\83\8a\83X\83g\83r\83\85\81[ =====*/\r
+       /*===== ローカル側のリストビュー =====*/\r
 \r
        hWndListLocal = CreateWindowEx(/*WS_EX_STATICEDGE*/WS_EX_CLIENTEDGE,\r
                        WC_LISTVIEWA, NULL,\r
@@ -180,7 +191,9 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
 \r
        if(hWndListLocal != NULL)\r
        {\r
-               LocalProcPtr = (WNDPROC)SetWindowLong(hWndListLocal, GWL_WNDPROC, (LONG)LocalWndProc);\r
+               // 64ビット対応\r
+//             LocalProcPtr = (WNDPROC)SetWindowLong(hWndListLocal, GWL_WNDPROC, (LONG)LocalWndProc);\r
+               LocalProcPtr = (WNDPROC)SetWindowLongPtr(hWndListLocal, GWLP_WNDPROC, (LONG_PTR)LocalWndProc);\r
 \r
            Tmp = SendMessage(hWndListLocal, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);\r
            Tmp |= LVS_EX_FULLROWSELECT;\r
@@ -219,7 +232,7 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
                SendMessage(hWndListLocal, LVM_INSERTCOLUMN, 3, (LPARAM)&LvCol);\r
        }\r
 \r
-       /*===== \83z\83X\83g\91¤\82Ì\83\8a\83X\83g\83r\83\85\81[ =====*/\r
+       /*===== ホスト側のリストビュー =====*/\r
 \r
        hWndListRemote = CreateWindowEx(/*WS_EX_STATICEDGE*/WS_EX_CLIENTEDGE,\r
                        WC_LISTVIEWA, NULL,\r
@@ -229,7 +242,9 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
 \r
        if(hWndListRemote != NULL)\r
        {\r
-               RemoteProcPtr = (WNDPROC)SetWindowLong(hWndListRemote, GWL_WNDPROC, (LONG)RemoteWndProc);\r
+               // 64ビット対応\r
+//             RemoteProcPtr = (WNDPROC)SetWindowLong(hWndListRemote, GWL_WNDPROC, (LONG)RemoteWndProc);\r
+               RemoteProcPtr = (WNDPROC)SetWindowLongPtr(hWndListRemote, GWLP_WNDPROC, (LONG_PTR)RemoteWndProc);\r
 \r
            Tmp = SendMessage(hWndListRemote, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);\r
            Tmp |= LVS_EX_FULLROWSELECT;\r
@@ -279,23 +294,23 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
                SendMessage(hWndListRemote, LVM_INSERTCOLUMN, 5, (LPARAM)&LvCol);\r
        }\r
 \r
-       Sts = SUCCESS;\r
+       Sts = FFFTP_SUCCESS;\r
        if((hWndListLocal == NULL) ||\r
           (hWndListRemote == NULL))\r
        {\r
-               Sts = FAIL;\r
+               Sts = FFFTP_FAIL;\r
        }\r
        return(Sts);\r
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\83E\83C\83\93\83h\83E\82ð\8dí\8f\9c ----------------------------------------\r
+/*----- ファイルリストウインドウを削除 ----------------------------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void DeleteListWin(void)\r
@@ -310,13 +325,13 @@ void DeleteListWin(void)
 }\r
 \r
 \r
-/*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· ------------------\r
+/*----- ローカル側のファイルリストのウインドウハンドルを返す ------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
+*              HWND ウインドウハンドル\r
 *----------------------------------------------------------------------------*/\r
 \r
 HWND GetLocalHwnd(void)\r
@@ -325,13 +340,13 @@ HWND GetLocalHwnd(void)
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· --------------------\r
+/*----- ホスト側のファイルリストのウインドウハンドルを返す --------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
+*              HWND ウインドウハンドル\r
 *----------------------------------------------------------------------------*/\r
 \r
 HWND GetRemoteHwnd(void)\r
@@ -340,16 +355,16 @@ HWND GetRemoteHwnd(void)
 }\r
 \r
 \r
-/*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83t\83@\83C\83\8b\83\8a\83X\83g\83E\83C\83\93\83h\83E\82Ì\83\81\83b\83Z\81[\83W\8f\88\97\9d ------------------\r
+/*----- ローカル側のファイルリストウインドウのメッセージ処理 ------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              UINT message  : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
-*              WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
-*              LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
+*              HWND hWnd : ウインドウハンドル\r
+*              UINT message  : メッセージ番号\r
+*              WPARAM wParam : メッセージの WPARAM 引数\r
+*              LPARAM lParam : メッセージの LPARAM 引数\r
 *\r
 *      Return Value\r
-*              \83\81\83b\83Z\81[\83W\82É\91Î\89\9e\82·\82é\96ß\82è\92l\r
+*              メッセージに対応する戻り値\r
 *----------------------------------------------------------------------------*/\r
 \r
 static LRESULT CALLBACK LocalWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
@@ -358,16 +373,16 @@ static LRESULT CALLBACK LocalWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\83\8a\83X\83g\83E\83C\83\93\83h\83E\82Ì\83\81\83b\83Z\81[\83W\8f\88\97\9d --------------------\r
+/*----- ホスト側のファイルリストウインドウのメッセージ処理 --------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              UINT message  : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
-*              WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
-*              LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
+*              HWND hWnd : ウインドウハンドル\r
+*              UINT message  : メッセージ番号\r
+*              WPARAM wParam : メッセージの WPARAM 引数\r
+*              LPARAM lParam : メッセージの LPARAM 引数\r
 *\r
 *      Return Value\r
-*              \83\81\83b\83Z\81[\83W\82É\91Î\89\9e\82·\82é\96ß\82è\92l\r
+*              メッセージに対応する戻り値\r
 *----------------------------------------------------------------------------*/\r
 \r
 static LRESULT CALLBACK RemoteWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
@@ -376,20 +391,20 @@ static LRESULT CALLBACK RemoteWndProc(HWND hWnd, UINT message, WPARAM wParam, LP
 }\r
 \r
 \r
-// \83_\83C\83A\83\8d\83O\83v\83\8d\83V\81[\83W\83\83\r
+// ダイアログプロシージャ\r
 static BOOL CALLBACK doOleDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)\r
 {\r
-#define TIMER_ID     (100)      // \8dì\90¬\82·\82é\83^\83C\83}\82Ì\8e¯\95ÊID\r
-#define TIMER_ELAPSE (100)       // WM_TIMER\82Ì\94­\90\8aÔ\8au\r
+#define TIMER_ID     (100)      // 作成するタイマの識別ID\r
+#define TIMER_ELAPSE (100)       // WM_TIMERの発生間隔\r
        MSG message;\r
 \r
        switch( msg ){\r
-       case WM_INITDIALOG:  // \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82ª\8dì\90¬\82³\82ê\82½\82Æ\82«\r
+       case WM_INITDIALOG:  // ダイアログボックスが作成されたとき\r
                SetTimer( hDlg, TIMER_ID, 0, NULL);\r
                return TRUE;\r
 \r
        case WM_TIMER:\r
-               ShowWindow(hDlg, SW_HIDE);  // \83_\83C\83A\83\8d\83O\82Í\89B\82·\r
+               ShowWindow(hDlg, SW_HIDE);  // ダイアログは隠す\r
 \r
                if (wp != TIMER_ID)\r
                        break;\r
@@ -408,18 +423,18 @@ static BOOL CALLBACK doOleDlgProc(HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
                SetTimer( hDlg, TIMER_ID, TIMER_ELAPSE, NULL );\r
                return TRUE;\r
 \r
-       case WM_COMMAND:     // \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\93à\82Ì\89½\82©\82ª\91I\91ð\82³\82ê\82½\82Æ\82«\r
+       case WM_COMMAND:     // ダイアログボックス内の何かが選択されたとき\r
                switch( LOWORD( wp ) ){\r
-//             case IDOK:       // \81uOK\81v\83{\83^\83\93\82ª\91I\91ð\82³\82ê\82½\r
-               case IDCANCEL:   // \81u\83L\83\83\83\93\83Z\83\8b\81v\83{\83^\83\93\82ª\91I\91ð\82³\82ê\82½\r
-                       // \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82ð\8fÁ\82·\r
+//             case IDOK:       // 「OK」ボタンが選択された\r
+               case IDCANCEL:   // 「キャンセル」ボタンが選択された\r
+                       // ダイアログボックスを消す\r
                        EndDialog( hDlg, 0 );\r
                        break;\r
                }\r
                return TRUE;\r
        }\r
 \r
-       return FALSE;  // DefWindowProc()\82Å\82Í\82È\82­\81AFALSE\82ð\95Ô\82·\82±\82Æ\81I\r
+       return FALSE;  // DefWindowProc()ではなく、FALSEを返すこと!\r
 #undef TIMER_ID     \r
 #undef TIMER_ELAPSE \r
 }\r
@@ -431,11 +446,13 @@ static void doTransferRemoteFile(void)
        int CancelFlg = NO;\r
        char LocDir[FMAX_PATH+1];\r
        char TmpDir[FMAX_PATH+1];\r
-       char buf[32];\r
+       // 環境依存の不具合対策\r
+//     char buf[32];\r
        int i;\r
-       DWORD pid;\r
+       // 環境依存の不具合対策\r
+//     DWORD pid;\r
 \r
-       // \82·\82Å\82É\83\8a\83\82\81[\83g\82©\82ç\93]\91\97\8dÏ\82Ý\82È\82ç\89½\82à\82µ\82È\82¢\81B(2007.9.3 yutaka)\r
+       // すでにリモートから転送済みなら何もしない。(2007.9.3 yutaka)\r
        if (remoteFileListBase != NULL)\r
                return;\r
 \r
@@ -447,12 +464,17 @@ static void doTransferRemoteFile(void)
        // set temporary folder\r
        AskLocalCurDir(LocDir, FMAX_PATH);\r
 \r
-       // \83A\83v\83\8a\82ð\91½\8fd\8bN\93®\82µ\82Ä\82à\83R\83\93\83t\83\8a\83N\83g\82µ\82È\82¢\82æ\82¤\82É\81A\83e\83\93\83|\83\89\83\8a\83t\83H\83\8b\83_\96¼\82É\83v\83\8d\83Z\83XID\r
-       // \82ð\95t\89Á\82·\82é\81B(2007.9.13 yutaka)\r
-       GetTempPath(sizeof(TmpDir), TmpDir);\r
-       pid = GetCurrentProcessId();\r
-       _snprintf_s(buf, sizeof(buf), _TRUNCATE, "ffftp%d", pid);\r
-       strncat_s(TmpDir, sizeof(TmpDir), buf, _TRUNCATE);\r
+       // アプリを多重起動してもコンフリクトしないように、テンポラリフォルダ名にプロセスID\r
+       // を付加する。(2007.9.13 yutaka)\r
+       // 環境依存の不具合対策\r
+//     GetTempPath(sizeof(TmpDir), TmpDir);\r
+//     pid = GetCurrentProcessId();\r
+//     _snprintf_s(buf, sizeof(buf), _TRUNCATE, "ffftp%d", pid);\r
+//     strncat_s(TmpDir, sizeof(TmpDir), buf, _TRUNCATE);\r
+       GetAppTempPath(TmpDir);\r
+       _mkdir(TmpDir);\r
+       SetYenTail(TmpDir);\r
+       strcat(TmpDir, "file");\r
        _mkdir(TmpDir);\r
 #if 0\r
        if (TmpDir[strlen(TmpDir) - 1] == '\\') {\r
@@ -460,7 +482,7 @@ static void doTransferRemoteFile(void)
        }\r
 #endif\r
 \r
-       // \8aù\91\82Ì\83t\83@\83C\83\8b\82ð\8dí\8f\9c\82·\82é\r
+       // 既存のファイルを削除する\r
        for (pf = FileListBase ; pf ; pf = pf->Next) {\r
                char fn[FMAX_PATH+1];\r
 \r
@@ -471,10 +493,10 @@ static void doTransferRemoteFile(void)
                remove(fn);\r
        }\r
 \r
-       // \83_\83E\83\93\83\8d\81[\83h\90æ\82ð\83e\83\93\83|\83\89\83\8a\82É\90Ý\92è\r
+       // ダウンロード先をテンポラリに設定\r
        SetLocalDirHist(TmpDir);\r
 \r
-       // FFFTP\82É\83_\83E\83\93\83\8d\81[\83h\97v\8b\81\82ð\8fo\82µ\81A\83_\83E\83\93\83\8d\81[\83h\82Ì\8a®\97¹\82ð\91Ò\82Â\81B\r
+       // FFFTPにダウンロード要求を出し、ダウンロードの完了を待つ。\r
        PostMessage(GetMainHwnd(), WM_COMMAND, MAKEWPARAM(MENU_DOWNLOAD, 0), 0);\r
 \r
        for (i = 0 ; i < 10 ; i++) {\r
@@ -485,7 +507,7 @@ static void doTransferRemoteFile(void)
                        DispatchMessage(&msg);\r
 \r
                } else {\r
-                       // \93]\91\97\83X\83\8c\83b\83h\82ª\93®\82«\8fo\82µ\82½\82ç\94²\82¯\82é\81B\r
+                       // 転送スレッドが動き出したら抜ける。\r
                        if (AskTransferNow() == YES)\r
                                break;\r
                }\r
@@ -493,17 +515,17 @@ static void doTransferRemoteFile(void)
                Sleep(10);\r
        }\r
 \r
-       // OLE D&D\92\86\82É\83\81\83C\83\93\83E\83B\83\93\83h\83E\82ð\83\86\81[\83U\82É\91\80\8dì\82³\82¹\82é\82Æ\81A\82¨\82©\82µ\82­\82È\82é\82Ì\82Å\81A\r
-       // \89B\82µ\83\82\81[\83_\83\8b\83_\83C\83A\83\8d\83O\82ð\8dì\82é\81B\r
+       // OLE D&D中にメインウィンドウをユーザに操作させると、おかしくなるので、\r
+       // 隠しモーダルダイアログを作る。\r
        // (2007.9.11 yutaka)\r
        DialogBox(GetFtpInst(), MAKEINTRESOURCE(IDD_OLEDRAG), GetMainHwnd(), (DLGPROC)doOleDlgProc);\r
 \r
-       // \83_\83E\83\93\83\8d\81[\83h\90æ\82ð\8c³\82É\96ß\82·\r
+       // ダウンロード先を元に戻す\r
        SetLocalDirHist(LocDir);\r
        SetCurrentDirAsDirHist();\r
 \r
-       remoteFileListBase = FileListBase;  // \82 \82Æ\82Å\83t\83\8a\81[\82·\82é\82±\82Æ\r
-       remoteFileListBaseNoExpand = FileListBaseNoExpand;  // \82 \82Æ\82Å\83t\83\8a\81[\82·\82é\82±\82Æ\r
+       remoteFileListBase = FileListBase;  // あとでフリーすること\r
+       remoteFileListBaseNoExpand = FileListBaseNoExpand;  // あとでフリーすること\r
        strncpy_s(remoteFileDir, sizeof(remoteFileDir), TmpDir, _TRUNCATE);\r
 \r
 #if 0\r
@@ -535,7 +557,7 @@ int isDirectory(char *fn)
        return 0;\r
 }\r
 \r
-// \83e\83\93\83|\83\89\83\8a\82Ì\83t\83@\83C\83\8b\82¨\82æ\82Ñ\83t\83H\83\8b\83_\82ð\8dí\8f\9c\82·\82é\81B\r
+// テンポラリのファイルおよびフォルダを削除する。\r
 void doDeleteRemoteFile(void)\r
 {\r
        if (remoteFileListBase != NULL) {\r
@@ -564,9 +586,9 @@ void doDeleteRemoteFile(void)
                                strncat_s(fn, sizeof(fn), "\\", _TRUNCATE);\r
                                strncat_s(fn, sizeof(fn), pf->File, _TRUNCATE);\r
                                if (isDirectory(fn)) {\r
-                                       if (_rmdir(fn) == 0) { // \83f\83B\83\8c\83N\83g\83\8a\82ð\8fÁ\82¹\82½\82ç\83J\83E\83\93\83g\83A\83b\83v\r
+                                       if (_rmdir(fn) == 0) { // ディレクトリを消せたらカウントアップ\r
                                                count++;\r
-                                               if (count >= dirs)  // \82·\82×\82Ä\8fÁ\82¹\82½\82ç\8fI\82í\82è\r
+                                               if (count >= dirs)  // すべて消せたら終わり\r
                                                        goto skip;\r
                                        }\r
                                }\r
@@ -574,7 +596,7 @@ void doDeleteRemoteFile(void)
                        }\r
                }\r
 skip:\r
-               _rmdir(remoteFileDir);  // \8e©\95ª\82Å\8dì\82Á\82½\83f\83B\83\8c\83N\83g\83\8a\82à\8fÁ\82·\r
+               _rmdir(remoteFileDir);  // 自分で作ったディレクトリも消す\r
 #else\r
                SHFILEOPSTRUCT FileOp = { NULL, FO_DELETE, remoteFileDir, NULL, \r
                        FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI, \r
@@ -595,7 +617,7 @@ skip:
 \r
 // yutaka\r
 // cf. http://www.nakka.com/lib/\r
-/* \83h\83\8d\83b\83v\83t\83@\83C\83\8b\82Ì\8dì\90¬ */\r
+/* ドロップファイルの作成 */\r
 static HDROP APIPRIVATE CreateDropFileMem(char **FileName,int cnt,BOOL fWide)\r
 {\r
        HDROP hDrop;\r
@@ -605,18 +627,18 @@ static HDROP APIPRIVATE CreateDropFileMem(char **FileName,int cnt,BOOL fWide)
        int i;\r
        \r
        if(fWide == TRUE){\r
-               /* \83\8f\83C\83h\83L\83\83\83\89 */\r
+               /* ワイドキャラ */\r
                for(i = 0;i < cnt;i++){\r
-                       // UTF-8\91Î\89\9e\r
+                       // UTF-8対応\r
 //                     MultiByteToWideChar(CP_ACP,0,FileName[i],-1,wbuf,BUF_SIZE);\r
 //                     flen += (wcslen(wbuf) + 1) * sizeof(wchar_t);\r
                        flen += sizeof(wchar_t) * MtoW(NULL, 0, FileName[i], -1);\r
                }\r
                flen++;\r
        }else{\r
-               /* \83}\83\8b\83`\83o\83C\83g */\r
+               /* マルチバイト */\r
                for(i = 0;i < cnt;i++){\r
-                       // UTF-8\91Î\89\9e\r
+                       // UTF-8対応\r
 //                     flen += lstrlen(FileName[i]) + 1;\r
                        MtoW(wbuf, BUF_SIZE, FileName[i], -1);\r
                        flen += sizeof(char) * WtoA(NULL, 0, wbuf, -1);\r
@@ -629,32 +651,32 @@ static HDROP APIPRIVATE CreateDropFileMem(char **FileName,int cnt,BOOL fWide)
        }\r
 \r
        lpDropFile = (LPDROPFILES) GlobalLock(hDrop);\r
-       lpDropFile->pFiles = sizeof(DROPFILES);         /* \83t\83@\83C\83\8b\96¼\82Ì\83\8a\83X\83g\82Ü\82Å\82Ì\83I\83t\83Z\83b\83g */\r
+       lpDropFile->pFiles = sizeof(DROPFILES);         /* ファイル名のリストまでのオフセット */\r
        lpDropFile->pt.x = 0;\r
        lpDropFile->pt.y = 0;\r
        lpDropFile->fNC = FALSE;\r
-       lpDropFile->fWide = fWide;                                      /* \83\8f\83C\83h\83L\83\83\83\89\82Ì\8fê\8d\87\82Í TRUE */\r
+       lpDropFile->fWide = fWide;                                      /* ワイドキャラの場合は TRUE */\r
 \r
-       /* \8d\\91¢\91Ì\82Ì\8cã\82ë\82É\83t\83@\83C\83\8b\96¼\82Ì\83\8a\83X\83g\82ð\83R\83s\81[\82·\82é\81B(\83t\83@\83C\83\8b\96¼\0\83t\83@\83C\83\8b\96¼\0\83t\83@\83C\83\8b\96¼\0\0) */\r
+       /* 構造体の後ろにファイル名のリストをコピーする。(ファイル名\0ファイル名\0ファイル名\0\0) */\r
        if(fWide == TRUE){\r
-               /* \83\8f\83C\83h\83L\83\83\83\89 */\r
+               /* ワイドキャラ */\r
                wchar_t *buf;\r
 \r
                buf = (wchar_t *)(&lpDropFile[1]);\r
                for(i = 0;i < cnt;i++){\r
-                       // UTF-8\91Î\89\9e\r
+                       // UTF-8対応\r
 //                     MultiByteToWideChar(CP_ACP,0,FileName[i],-1,wbuf,BUF_SIZE);\r
 //                     wcscpy(buf,wbuf);\r
 //                     buf += wcslen(wbuf) + 1;\r
                        buf += MtoW(buf, BUF_SIZE, FileName[i], -1);\r
                }\r
        }else{\r
-               /* \83}\83\8b\83`\83o\83C\83g */\r
+               /* マルチバイト */\r
                char *buf;\r
 \r
                buf = (char *)(&lpDropFile[1]);\r
                for(i = 0;i < cnt;i++){\r
-                       // UTF-8\91Î\89\9e\r
+                       // UTF-8対応\r
 //                     lstrcpy(buf,FileName[i]);\r
 //                     buf += lstrlen(FileName[i]) + 1;\r
                        MtoW(wbuf, BUF_SIZE, FileName[i], -1);\r
@@ -667,7 +689,7 @@ static HDROP APIPRIVATE CreateDropFileMem(char **FileName,int cnt,BOOL fWide)
 }\r
 \r
 \r
-// OLE D&D\82ð\8aJ\8en\82·\82é \r
+// OLE D&Dを開始する \r
 // (2007.8.30 yutaka)\r
 static void doDragDrop(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
 {\r
@@ -675,16 +697,16 @@ static void doDragDrop(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        POINT pt;\r
        int ret;\r
 \r
-       // \83e\83\93\83|\83\89\83\8a\82ð\82«\82ê\82¢\82É\82·\82é (2007.9.3 yutaka)\r
+       // テンポラリをきれいにする (2007.9.3 yutaka)\r
        doDeleteRemoteFile();\r
 \r
-       /* \83h\83\89\83b\83O&\83h\83\8d\83b\83v\82Ì\8aJ\8en */\r
+       /* ドラッグ&ドロップの開始 */\r
        cf[0] = CF_HDROP;\r
-       cf[1] = CF_HDROP;       /* \83t\83@\83C\83\8b */\r
+       cf[1] = CF_HDROP;       /* ファイル */\r
        if((ret = OLE_IDropSource_Start(hWnd,WM_GETDATA, WM_DRAGOVER, cf,1,DROPEFFECT_COPY | DROPEFFECT_MOVE | DROPEFFECT_LINK)) == DROPEFFECT_MOVE){\r
        }\r
 \r
-       // \83h\83\8d\83b\83v\90æ\82Ì\83A\83v\83\8a\82É WM_LBUTTONUP \82ð\94ò\82Î\82·\81B\r
+       // ドロップ先のアプリに WM_LBUTTONUP を飛ばす。\r
        GetCursorPos(&pt);\r
        ScreenToClient(hWnd, &pt);\r
        PostMessage(hWnd,WM_LBUTTONUP,0,MAKELPARAM(pt.x,pt.y));\r
@@ -692,16 +714,16 @@ static void doDragDrop(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 \r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82Ì\8b¤\92Ê\83\81\83b\83Z\81[\83W\8f\88\97\9d ----------------------------\r
+/*----- ファイル一覧ウインドウの共通メッセージ処理 ----------------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              UINT message  : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
-*              WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
-*              LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
+*              HWND hWnd : ウインドウハンドル\r
+*              UINT message  : メッセージ番号\r
+*              WPARAM wParam : メッセージの WPARAM 引数\r
+*              LPARAM lParam : メッセージの LPARAM 引数\r
 *\r
 *      Return Value\r
-*              \83\81\83b\83Z\81[\83W\82É\91Î\89\9e\82·\82é\96ß\82è\92l\r
+*              メッセージに対応する戻り値\r
 *----------------------------------------------------------------------------*/\r
 \r
 static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
@@ -764,7 +786,10 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        return(CallWindowProc(ProcPtr, hWnd, message, wParam, lParam));\r
 \r
                case WM_DROPFILES :\r
-                       // \83h\83\89\83b\83O\92\86\82Í\8f\88\97\9d\82µ\82È\82¢\81B\83h\83\89\83b\83O\8cã\82ÉWM_LBUTTONDOWN\82ª\94ò\82ñ\82Å\82­\82é\82½\82ß\81A\82»\82±\82Å\8f\88\97\9d\82·\82é\81B\r
+                       // 同時接続対応\r
+                       if(AskUserOpeDisabled() == YES)\r
+                               break;\r
+                       // ドラッグ中は処理しない。ドラッグ後にWM_LBUTTONDOWNが飛んでくるため、そこで処理する。\r
                        if (Dragging == YES) \r
                                return (FALSE);\r
 \r
@@ -796,6 +821,9 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                hCsrDrg = LoadCursor(NULL, IDC_ARROW);\r
                                SetCursor(hCsrDrg);\r
 \r
+                               // 同時接続対応\r
+                               if(AskUserOpeDisabled() == YES)\r
+                                       break;\r
                                Point.x = (long)(short)LOWORD(lParam);\r
                                Point.y = (long)(short)HIWORD(lParam);\r
                                ClientToScreen(hWnd, &Point);\r
@@ -807,9 +835,9 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                        } else if(hWndPnt == hWndListLocal) {\r
                                                PostMessage(GetMainHwnd(), WM_COMMAND, MAKEWPARAM(MENU_DOWNLOAD, 0), 0);\r
                                        }\r
-                               } else { // \93¯\88ê\83E\83B\83\93\83h\83E\93à\82Ì\8fê\8d\87 (yutaka)\r
+                               } else { // 同一ウィンドウ内の場合 (yutaka)\r
                                        if (hWndDragStart == hWndListRemote && hWndPnt == hWndListRemote) {\r
-                                               // remote <-> remote\82Ì\8fê\8d\87\82Í\81A\83T\81[\83o\82Å\82Ì\83t\83@\83C\83\8b\82Ì\88Ú\93®\82ð\8ds\82¤\81B(2007.9.5 yutaka)\r
+                                               // remote <-> remoteの場合は、サーバでのファイルの移動を行う。(2007.9.5 yutaka)\r
                                                if (RemoteDropFileIndex != -1) {\r
                                                        ListView_SetItemState(hWnd, RemoteDropFileIndex, 0, LVIS_DROPHILITED);\r
                                                        MoveRemoteFileProc(RemoteDropFileIndex);\r
@@ -822,15 +850,15 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        return(CallWindowProc(ProcPtr, hWnd, message, wParam, lParam));\r
 \r
                case WM_DRAGDROP:  \r
-                       // OLE D&D\82ð\8aJ\8en\82·\82é (yutaka)\r
+                       // OLE D&Dを開始する (yutaka)\r
                        doDragDrop(hWnd, message, wParam, lParam);\r
                        return (TRUE);\r
                        break;\r
  \r
-               case WM_GETDATA:  // \83t\83@\83C\83\8b\82Ì\83p\83X\82ðD&D\90æ\82Ì\83A\83v\83\8a\82Ö\95Ô\82· (yutaka)\r
+               case WM_GETDATA:  // ファイルのパスをD&D先のアプリへ返す (yutaka)\r
                        switch(wParam)\r
                        {\r
-                       case CF_HDROP:          /* \83t\83@\83C\83\8b */\r
+                       case CF_HDROP:          /* ファイル */\r
                                {\r
                                        OSVERSIONINFO os_info;\r
                                        BOOL NTFlag = FALSE;\r
@@ -843,15 +871,18 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                        char LocDir[FMAX_PATH+1];\r
                                        char *PathDir;\r
  \r
-                                       // \95Ï\90\94\82ª\96¢\8f\89\8aú\89»\82Ì\83o\83O\8fC\90³\r
+                                       // 変数が未初期化のバグ修正\r
                                        FileListBaseNoExpand = NULL;\r
-                                       // \83\8d\81[\83J\83\8b\91¤\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ðFileListBase\82É\93o\98^\r
+                                       // ローカル側で選ばれているファイルをFileListBaseに登録\r
                                        if (hWndDragStart == hWndListLocal) {\r
                                                AskLocalCurDir(LocDir, FMAX_PATH);\r
                                                PathDir = LocDir;\r
  \r
                                                FileListBase = NULL;\r
-                                               MakeSelectedFileList(WIN_LOCAL, YES, NO, &FileListBase, &CancelFlg);                    \r
+                                               // ローカル側からアプリケーションにD&Dできないバグ修正\r
+//                                             MakeSelectedFileList(WIN_LOCAL, YES, NO, &FileListBase, &CancelFlg);                    \r
+                                               MakeSelectedFileList(WIN_LOCAL, NO, NO, &FileListBase, &CancelFlg);                     \r
+                                               FileListBaseNoExpand = FileListBase;\r
  \r
                                        } else if (hWndDragStart == hWndListRemote) {\r
                                                GetCursorPos(&Point);\r
@@ -862,8 +893,8 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                                        FileListBase = NULL;\r
  \r
                                                } else {\r
-                                                       // \91I\91ð\82³\82ê\82Ä\82¢\82é\83\8a\83\82\81[\83g\83t\83@\83C\83\8b\82Ì\83\8a\83X\83g\83A\83b\83v\r
-                                                       // \82±\82Ì\83^\83C\83~\83\93\83O\82Å\83\8a\83\82\81[\83g\82©\82ç\83\8d\81[\83J\83\8b\82Ì\88ê\8e\9e\83t\83H\83\8b\83_\82Ö\83_\83E\83\93\83\8d\81[\83h\82·\82é\r
+                                                       // 選択されているリモートファイルのリストアップ\r
+                                                       // このタイミングでリモートからローカルの一時フォルダへダウンロードする\r
                                                        // (2007.8.31 yutaka)\r
                                                        doTransferRemoteFile();\r
                                                        PathDir = remoteFileDir;\r
@@ -873,18 +904,23 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
  \r
                                        } \r
  \r
+#if defined(HAVE_TANDEM)\r
+                                       if(FileListBaseNoExpand == NULL)\r
+                                               pf = FileListBase;\r
+                                       else\r
+#endif\r
                                        pf = FileListBaseNoExpand;\r
                                        for (filenum = 0; pf ; filenum++) {\r
                                                pf = pf->Next;\r
                                        }\r
-                                       // \83t\83@\83C\83\8b\82ª\96¢\91I\91ð\82Ì\8fê\8d\87\82Í\89½\82à\82µ\82È\82¢\81B(yutaka)\r
+                                       // ファイルが未選択の場合は何もしない。(yutaka)\r
                                        if (filenum <= 0) {\r
                                                *((HANDLE *)lParam) = NULL;\r
                                                return (FALSE);\r
                                        }\r
                                        \r
-                                       /* \83t\83@\83C\83\8b\96¼\82Ì\94z\97ñ\82ð\8dì\90¬\82·\82é */\r
-                                       // TODO: GlobalAlloc\82ª\95Ô\82·\82Ì\82Í\83\81\83\82\83\8a\83|\83C\83\93\83^\82Å\82Í\82È\82­\83n\83\93\83h\83\8b\82¾\82ª\8eÀ\8dÛ\82Í\93¯\82\92l\r
+                                       /* ファイル名の配列を作成する */\r
+                                       // TODO: GlobalAllocが返すのはメモリポインタではなくハンドルだが実際は同じ値\r
                                        FileNameList = (char **)GlobalAlloc(GPTR,sizeof(char *) * filenum);\r
                                        if(FileNameList == NULL){\r
                                                abort();\r
@@ -899,7 +935,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                                pf = pf->Next;\r
 #if 0\r
                                                if (FileListBase->Node == NODE_DIR) { \r
-                                                       // \83t\83H\83\8b\83_\82ð\92Í\82ñ\82¾\8fê\8d\87\82Í\82»\82ê\88È\8d~\93W\8aJ\82µ\82È\82¢\r
+                                                       // フォルダを掴んだ場合はそれ以降展開しない\r
                                                        filenum = 1;\r
                                                        break;\r
                                                }\r
@@ -912,11 +948,11 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                                NTFlag = TRUE;\r
                                        }\r
  \r
-                                       /* \83h\83\8d\83b\83v\83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\8dì\90¬ */\r
-                                       /* NT\82Ì\8fê\8d\87\82ÍUNICODE\82É\82È\82é\82æ\82¤\82É\82·\82é */\r
+                                       /* ドロップファイルリストの作成 */\r
+                                       /* NTの場合はUNICODEになるようにする */\r
                                        *((HANDLE *)lParam) = CreateDropFileMem(FileNameList, filenum, NTFlag);\r
  \r
-                                       /* \83t\83@\83C\83\8b\96¼\82Ì\94z\97ñ\82ð\89ð\95ú\82·\82é */\r
+                                       /* ファイル名の配列を解放する */\r
                                        for (i = 0; i < filenum ; i++) {\r
                                                GlobalFree(FileNameList[i]);\r
                                        }\r
@@ -925,7 +961,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                        if (hWndDragStart == hWndListLocal) {\r
                                                DeleteFileList(&FileListBase);\r
                                        } else {\r
-                                               // \82 \82Æ\82Å\83t\83@\83C\83\8b\8dí\8f\9c\82µ\82Ä\83t\83\8a\81[\82·\82é\r
+                                               // あとでファイル削除してフリーする\r
                                        }\r
  \r
                                        return (TRUE);\r
@@ -945,7 +981,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                int Node, index;\r
                                static int prev_index = -1;\r
 \r
-                               // \93¯\88ê\83E\83B\83\93\83h\83E\93à\82Å\82ÌD&D\82Í\83\8a\83\82\81[\83g\91¤\82Ì\82Ý\r
+                               // 同一ウィンドウ内でのD&Dはリモート側のみ\r
                                if (Win != WIN_REMOTE)\r
                                        break;\r
 \r
@@ -960,7 +996,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
 \r
                                hi.pt = Point;\r
 \r
-                               // \88È\91O\82Ì\91I\91ð\82ð\8fÁ\82·\r
+                               // 以前の選択を消す\r
                                ListView_SetItemState(hWnd, prev_index, 0, LVIS_DROPHILITED);\r
                                RemoteDropFileIndex = -1;\r
 \r
@@ -981,7 +1017,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        break;\r
 \r
                case WM_RBUTTONDOWN :\r
-                       /* \82±\82±\82Å\83t\83@\83C\83\8b\82ð\91I\82Ô */\r
+                       /* ここでファイルを選ぶ */\r
                        CallWindowProc(ProcPtr, hWnd, message, wParam, lParam);\r
 \r
                        EraseListViewTips();\r
@@ -1021,13 +1057,13 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                        if((hWndPnt == hWndListRemote) || (hWndPnt == hWndListLocal))\r
                                                SetCursor(hCsrDrg);\r
                                        else {\r
-                                               // \83}\83E\83X\83|\83C\83\93\83^\82Ì\81~\95\\8e¦\82ð\82â\82ß\82é (yutaka)\r
+                                               // マウスポインタの×表示をやめる (yutaka)\r
 #if 0\r
                                                SetCursor(hCsrNoDrg);\r
 #endif\r
                                        }\r
 \r
-                                       // OLE D&D\82Ì\8aJ\8en\82ð\8ew\8e¦\82·\82é\r
+                                       // OLE D&Dの開始を指示する\r
                                        PostMessage(hWnd, WM_DRAGDROP, MAKEWPARAM(wParam, lParam), 0);\r
 \r
                                }\r
@@ -1073,13 +1109,13 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\83^\83u\95\9d\82ð\8eæ\93¾\82·\82é --------------------------------------\r
+/*----- ファイルリストのタブ幅を取得する --------------------------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void GetListTabWidth(void)\r
@@ -1104,56 +1140,74 @@ void GetListTabWidth(void)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\95û\96@\82É\82µ\82½\82ª\82Á\82Ä\83\8a\83X\83g\83r\83\85\81[\82ð\90Ý\92è\82·\82é --------------------\r
+/*----- ファイル一覧方法にしたがってリストビューを設定する --------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void SetListViewType(void)\r
 {\r
-       long lStyle;\r
+       // 64ビット対応\r
+//     long lStyle;\r
+       LONG_PTR lStyle;\r
 \r
        switch(ListType)\r
        {\r
                case LVS_LIST :\r
-                       lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetLocalHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_LIST;\r
-                       SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetLocalHwnd(), GWL_STYLE, lStyle);\r
 \r
-                       lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_LIST;\r
-                       SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
                        break;\r
 \r
                default :\r
-                       lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetLocalHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_REPORT;\r
-                       SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetLocalHwnd(), GWL_STYLE, lStyle);\r
 \r
-                       lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_REPORT;\r
-                       SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
                        break;\r
        }\r
        return;\r
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82É\83t\83@\83C\83\8b\96¼\82ð\83Z\83b\83g ------------------\r
+/*----- ホスト側のファイル一覧ウインドウにファイル名をセット ------------------\r
 *\r
 *      Parameter\r
-*              int Mode : \83L\83\83\83b\83V\83\85\83\82\81[\83h (CACHE_xxx)\r
+*              int Mode : キャッシュモード (CACHE_xxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)\r
@@ -1215,7 +1269,7 @@ void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)
                        {\r
                                ListType = LIST_UNKNOWN;\r
 \r
-                               while(GetListOneLine(Str, FMAX_PATH, fd) == SUCCESS)\r
+                               while(GetListOneLine(Str, FMAX_PATH, fd) == FFFTP_SUCCESS)\r
                                {\r
                                        if((ListType = AnalizeFileInfo(Str)) != LIST_UNKNOWN)\r
                                        {\r
@@ -1236,7 +1290,7 @@ void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)
                                DispFileList2View(GetRemoteHwnd(), &Anchor);\r
                                EraseDispFileList(&Anchor);\r
 \r
-                               // \90æ\93ª\82Ì\83A\83C\83e\83\80\82ð\91I\91ð\r
+                               // 先頭のアイテムを選択\r
                                ListView_SetItemState(GetRemoteHwnd(), 0, LVIS_FOCUSED, LVIS_FOCUSED);\r
                        }\r
                        else\r
@@ -1248,8 +1302,8 @@ void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)
                else\r
                {\r
 #if defined(HAVE_OPENVMS)\r
-                       /* OpenVMS\82Ì\8fê\8d\87\8bó\83f\83B\83\8c\83N\83g\83\8a\88Ú\93®\82Ì\8e\9e\82É\8fo\82é\82Ì\82Å\81A\83\81\83b\83Z\81[\83W\82¾\82¯\8fo\82³\82È\82¢\r
-                        * \82æ\82¤\82É\82·\82é(VIEW\82Í\83N\83\8a\83A\82µ\82Ä\97Ç\82¢) */\r
+                       /* OpenVMSの場合空ディレクトリ移動の時に出るので、メッセージだけ出さない\r
+                        * ようにする(VIEWはクリアして良い) */\r
                        if (AskHostType() != HTYPE_VMS)\r
 #endif\r
                        SetTaskMsg(MSGJPN049);\r
@@ -1268,15 +1322,66 @@ void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)
 }\r
 \r
 \r
-/*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82É\83t\83@\83C\83\8b\96¼\82ð\83Z\83b\83g ----------------\r
+/*----- ローカル側のファイル一覧ウインドウにファイル名をセット ----------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
+// ファイルアイコン表示対応\r
+void RefreshIconImageList(FLISTANCHOR *Anchor)\r
+{\r
+       HBITMAP hBitmap;\r
+       int ImageId;\r
+       FILELIST *Pos;\r
+       int i;\r
+       char Cur[FMAX_PATH+1];\r
+       SHFILEINFO FileInfo;\r
+       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+       ShowWindow(hWndListLocal, SW_SHOW);\r
+       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+       ShowWindow(hWndListRemote, SW_SHOW);\r
+       ImageList_Destroy(ListImg);\r
+       ListImg = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR24, 0, 1);\r
+       hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr_bmp));\r
+       ImageList_AddMasked(ListImg, hBitmap, RGB(255,0,0));\r
+       DeleteObject(hBitmap);\r
+       ImageId = 0;\r
+       Pos = Anchor->Top;\r
+       for(i = 0; i < Anchor->Files; i++)\r
+       {\r
+               Pos->ImageId = -1;\r
+               if(AskDispFileIcon() == YES)\r
+               {\r
+                       if(Pos->Node == NODE_DRIVE)\r
+                               strcpy(Cur, Pos->File);\r
+                       else\r
+                       {\r
+                               AskLocalCurDir(Cur, FMAX_PATH);\r
+                               SetYenTail(Cur);\r
+                               strcat(Cur, Pos->File);\r
+                       }\r
+                       if(SHGetFileInfoM(Cur, 0, &FileInfo, sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_ICON) != 0)\r
+                       {\r
+                               if(ImageList_AddIcon(ListImg, FileInfo.hIcon) >= 0)\r
+                               {\r
+                                       Pos->ImageId = ImageId;\r
+                                       ImageId++;\r
+                               }\r
+                               DestroyIcon(FileInfo.hIcon);\r
+                       }\r
+               }\r
+               Pos = Pos->Next;\r
+       }\r
+       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+       ShowWindow(hWndListLocal, SW_SHOW);\r
+       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+       ShowWindow(hWndListRemote, SW_SHOW);\r
+}\r
+\r
 void GetLocalDirForWnd(void)\r
 {\r
        HANDLE fHnd;\r
@@ -1296,7 +1401,7 @@ void GetLocalDirForWnd(void)
        SetLocalDirHist(Scan);\r
        DispLocalFreeSpace(Scan);\r
 \r
-       /* \83f\83B\83\8c\83N\83g\83\8a\81^\83t\83@\83C\83\8b */\r
+       /* ディレクトリ/ファイル */\r
 \r
        SetYenTail(Scan);\r
        strcat(Scan, "*");\r
@@ -1325,7 +1430,7 @@ void GetLocalDirForWnd(void)
                FindClose(fHnd);\r
        }\r
 \r
-       /* \83h\83\89\83C\83u */\r
+       /* ドライブ */\r
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
@@ -1345,32 +1450,34 @@ void GetLocalDirForWnd(void)
                }\r
        }\r
 \r
+       // ファイルアイコン表示対応\r
+       RefreshIconImageList(&Anchor);\r
        DispFileList2View(GetLocalHwnd(), &Anchor);\r
        EraseDispFileList(&Anchor);\r
 \r
-       // \90æ\93ª\82Ì\83A\83C\83e\83\80\82ð\91I\91ð\r
+       // 先頭のアイテムを選択\r
        ListView_SetItemState(GetLocalHwnd(), 0, LVIS_FOCUSED, LVIS_FOCUSED);\r
 \r
        return;\r
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\8fî\95ñ\82ð\83t\83@\83C\83\8b\88ê\97\97\97p\83\8a\83X\83g\82É\93o\98^\82·\82é --------------------------\r
+/*----- ファイル情報をファイル一覧用リストに登録する --------------------------\r
 *\r
 *      Parameter\r
-*              FLISTANCHOR *Anchor : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
-*              char *Name : \83t\83@\83C\83\8b\96¼\r
-*              FILETIME *Time : \93ú\95t\r
-*              LONGLONG Size : \83T\83C\83Y\r
-*              int Attr : \91®\90«\r
-*              int Type : \83^\83C\83v (NODE_xxxx)\r
-*              int Link : \83\8a\83\93\83N\82©\82Ç\82¤\82© (YES/NO)\r
-*              char *Owner : \83I\81[\83i\96¼\r
-*              int InfoExist : \8fî\95ñ\82ª\82 \82é\82©\82Ç\82¤\82© (FINFO_xxx)\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
+*              FLISTANCHOR *Anchor : ファイルリストの先頭\r
+*              char *Name : ファイル名\r
+*              FILETIME *Time : 日付\r
+*              LONGLONG Size : サイズ\r
+*              int Attr : 属性\r
+*              int Type : タイプ (NODE_xxxx)\r
+*              int Link : リンクかどうか (YES/NO)\r
+*              char *Owner : オーナ名\r
+*              int InfoExist : 情報があるかどうか (FINFO_xxx)\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LONGLONG Size, int Attr, int Type, int Link, char *Owner, int InfoExist, int Win)\r
@@ -1411,6 +1518,11 @@ static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LON
                        {\r
                                if((((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
                                        ((Cmp = _mbsicmp(GetFileExt(Name), GetFileExt(Pos->File))) < 0)) ||\r
+#if defined(HAVE_TANDEM)\r
+                                  ((AskHostType() == HTYPE_TANDEM) &&\r
+                                   ((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
+                                       ((Cmp = Attr - Pos->Attr) < 0)) ||\r
+#endif\r
                                   (((Sort & SORT_MASK_ORD) == SORT_SIZE) &&\r
                                        ((Cmp = Size - Pos->Size) < 0)) ||\r
                                   (((Sort & SORT_MASK_ORD) == SORT_DATE) &&\r
@@ -1429,6 +1541,11 @@ static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LON
                        {\r
                                if((((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
                                        ((Cmp = _mbsicmp(GetFileExt(Name), GetFileExt(Pos->File))) > 0)) ||\r
+#if defined(HAVE_TANDEM)\r
+                                  ((AskHostType() == HTYPE_TANDEM) &&\r
+                                   ((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
+                                       ((Cmp = Attr - Pos->Attr) > 0)) ||\r
+#endif\r
                                   (((Sort & SORT_MASK_ORD) == SORT_SIZE) &&\r
                                        ((Cmp = Size - Pos->Size) > 0)) ||\r
                                   (((Sort & SORT_MASK_ORD) == SORT_DATE) &&\r
@@ -1475,13 +1592,13 @@ static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LON
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\97p\83\8a\83X\83g\82ð\83N\83\8a\83A\82·\82é --------------------------------------\r
+/*----- ファイル一覧用リストをクリアする --------------------------------------\r
 *\r
 *      Parameter\r
-*              FLISTANCHOR *Anchor : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              FLISTANCHOR *Anchor : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void EraseDispFileList(FLISTANCHOR *Anchor)\r
@@ -1503,14 +1620,14 @@ static void EraseDispFileList(FLISTANCHOR *Anchor)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\97p\83\8a\83X\83g\82Ì\93à\97e\82ð\83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82É\83Z\83b\83g ------------\r
+/*----- ファイル一覧用リストの内容をファイル一覧ウインドウにセット ------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              FLISTANCHOR *Anchor : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              HWND hWnd : ウインドウハンドル\r
+*              FLISTANCHOR *Anchor : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void DispFileList2View(HWND hWnd, FLISTANCHOR *Anchor)\r
@@ -1524,7 +1641,9 @@ static void DispFileList2View(HWND hWnd, FLISTANCHOR *Anchor)
        Pos = Anchor->Top;\r
        for(i = 0; i < Anchor->Files; i++)\r
        {\r
-               AddListView(hWnd, -1, Pos->File, Pos->Node, Pos->Size, &Pos->Time, Pos->Attr, Pos->Owner, Pos->Link, Pos->InfoExist);\r
+               // ファイルアイコン表示対応\r
+//             AddListView(hWnd, -1, Pos->File, Pos->Node, Pos->Size, &Pos->Time, Pos->Attr, Pos->Owner, Pos->Link, Pos->InfoExist);\r
+               AddListView(hWnd, -1, Pos->File, Pos->Node, Pos->Size, &Pos->Time, Pos->Attr, Pos->Owner, Pos->Link, Pos->InfoExist, Pos->ImageId);\r
                Pos = Pos->Next;\r
        }\r
 \r
@@ -1536,25 +1655,27 @@ static void DispFileList2View(HWND hWnd, FLISTANCHOR *Anchor)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\81i\83\8a\83X\83g\83r\83\85\81[\81j\82É\92Ç\89Á --------------------------\r
+/*----- ファイル一覧ウインドウ(リストビュー)に追加 --------------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              int Pos : \91}\93ü\88Ê\92u\r
-*              char *Name : \96¼\91O\r
-*              int Type : \83^\83C\83v (NIDE_xxxx)\r
-*              LONGLONG Size : \83T\83C\83Y\r
-*              FILETIME *Time : \93ú\95t\r
-*              int Attr : \91®\90«\r
-*              char Owner : \83I\81[\83i\96¼\r
-*              int Link : \83\8a\83\93\83N\82©\82Ç\82¤\82©\r
-*              int InfoExist : \8fî\95ñ\82ª\82 \82é\82©\82Ç\82¤\82© (FINFO_xxx)\r
+*              HWND hWnd : ウインドウハンドル\r
+*              int Pos : 挿入位置\r
+*              char *Name : 名前\r
+*              int Type : タイプ (NIDE_xxxx)\r
+*              LONGLONG Size : サイズ\r
+*              FILETIME *Time : 日付\r
+*              int Attr : 属性\r
+*              char Owner : オーナ名\r
+*              int Link : リンクかどうか\r
+*              int InfoExist : 情報があるかどうか (FINFO_xxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist)\r
+// ファイルアイコン表示対応\r
+//static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist)\r
+static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size, FILETIME *Time, int Attr, char *Owner, int Link, int InfoExist, int ImageId)\r
 {\r
        LV_ITEM LvItem;\r
        char Tmp[20];\r
@@ -1562,7 +1683,7 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        if(Pos == -1)\r
                Pos = SendMessage(hWnd, LVM_GETITEMCOUNT, 0, 0);\r
 \r
-       /* \83A\83C\83R\83\93/\83t\83@\83C\83\8b\96¼ */\r
+       /* アイコン/ファイル名 */\r
        LvItem.mask = LVIF_TEXT | LVIF_IMAGE;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 0;\r
@@ -1573,9 +1694,12 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
                LvItem.iImage = Type;\r
        else\r
                LvItem.iImage = 4;\r
+       // ファイルアイコン表示対応\r
+       if(hWnd == GetLocalHwnd() && ImageId >= 0)\r
+               LvItem.iImage = 5 + ImageId;\r
        LvItem.iItem = SendMessage(hWnd, LVM_INSERTITEM, 0, (LPARAM)&LvItem);\r
 \r
-       /* \93ú\95t/\8e\9e\8d\8f */\r
+       /* 日付/時刻 */\r
        FileTime2TimeString(Time, Tmp, DISPFORM_LEGACY, InfoExist);\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
@@ -1583,7 +1707,7 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        LvItem.pszText = Tmp;\r
        LvItem.iItem = SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&LvItem);\r
 \r
-       /* \83T\83C\83Y */\r
+       /* サイズ */\r
        if(Type == NODE_DIR)\r
                strcpy(Tmp, "<DIR>");\r
        else if(Type == NODE_DRIVE)\r
@@ -1598,18 +1722,28 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        LvItem.pszText = Tmp;\r
        LvItem.iItem = SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&LvItem);\r
 \r
-       /* \8ag\92£\8eq */\r
+       /* 拡張子 */\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 3;\r
+#if defined(HAVE_TANDEM)\r
+       if (AskHostType() == HTYPE_TANDEM) {\r
+               _itoa_s(Attr, Tmp, sizeof(Tmp), 10);\r
+               LvItem.pszText = Tmp;\r
+       } else\r
+#endif\r
        LvItem.pszText = GetFileExt(Name);\r
        LvItem.iItem = SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&LvItem);\r
 \r
        if(hWnd == GetRemoteHwnd())\r
        {\r
-               /* \91®\90« */\r
+               /* 属性 */\r
                strcpy(Tmp, "");\r
+#if defined(HAVE_TANDEM)\r
+               if((InfoExist & FINFO_ATTR) && (AskHostType() != HTYPE_TANDEM))\r
+#else\r
                if(InfoExist & FINFO_ATTR)\r
+#endif\r
                        AttrValue2String(Attr, Tmp);\r
                LvItem.mask = LVIF_TEXT;\r
                LvItem.iItem = Pos;\r
@@ -1617,7 +1751,7 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
                LvItem.pszText = Tmp;\r
                LvItem.iItem = SendMessage(hWnd, LVM_SETITEM, 0, (LPARAM)&LvItem);\r
 \r
-               /* \83I\81[\83i\96¼ */\r
+               /* オーナ名 */\r
                LvItem.mask = LVIF_TEXT;\r
                LvItem.iItem = Pos;\r
                LvItem.iSubItem = 5;\r
@@ -1628,13 +1762,13 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\96¼\88ê\97\97\83E\83C\83\93\83h\83E\82ð\83\\81[\83g\82µ\92¼\82· --------------------------------\r
+/*----- ファイル名一覧ウインドウをソートし直す --------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void ReSortDispList(int Win, int *CancelCheckWork)\r
@@ -1647,14 +1781,14 @@ void ReSortDispList(int Win, int *CancelCheckWork)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82Ì\83t\83@\83C\83\8b\82ð\91I\91ð\82·\82é ----------------------------\r
+/*----- ファイル一覧ウインドウのファイルを選択する ----------------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              int Type : \91I\91ð\95û\96@ (SELECT_xxx)\r
+*              HWND hWnd : ウインドウハンドル\r
+*              int Type : 選択方法 (SELECT_xxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void SelectFileInList(HWND hWnd, int Type)\r
@@ -1722,7 +1856,7 @@ void SelectFileInList(HWND hWnd, int Type)
                                                LvItem.state = 0;\r
                                                if(GetNodeType(Win, i) != NODE_DRIVE)\r
                                                {\r
-                                                       if(((FindMode == 0) && (CheckFname(Name, RegExp) == SUCCESS)) ||\r
+                                                       if(((FindMode == 0) && (CheckFname(Name, RegExp) == FFFTP_SUCCESS)) ||\r
                                                           ((FindMode != 0) && (JreGetStrMatchInfo(Name, 0) != NULL)))\r
                                                        {\r
                                                                LvItem.state = LVIS_SELECTED;\r
@@ -1778,19 +1912,21 @@ void SelectFileInList(HWND hWnd, int Type)
 }\r
 \r
 \r
-/*----- \91I\91ð\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------------------------------------------\r
+/*----- 選択ダイアログのコールバック ------------------------------------------\r
 *\r
 *      Parameter\r
-*              HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
-*              WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
-*              LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
+*              HWND hDlg : ウインドウハンドル\r
+*              UINT message : メッセージ番号\r
+*              WPARAM wParam : メッセージの WPARAM 引数\r
+*              LPARAM lParam : メッセージの LPARAM 引数\r
 *\r
 *      Return Value\r
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        switch (iMessage)\r
        {\r
@@ -1829,14 +1965,14 @@ static BOOL CALLBACK SelectDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wPara
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82Ì\83t\83@\83C\83\8b\82ð\8c\9f\8dõ\82·\82é ----------------------------\r
+/*----- ファイル一覧ウインドウのファイルを検索する ----------------------------\r
 *\r
 *      Parameter\r
-*              HWND hWnd : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
-*              int Type : \8c\9f\8dõ\95û\96@ (FIND_xxx)\r
+*              HWND hWnd : ウインドウハンドル\r
+*              int Type : 検索方法 (FIND_xxx)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void FindFileInList(HWND hWnd, int Type)\r
@@ -1876,7 +2012,7 @@ void FindFileInList(HWND hWnd, int Type)
                                                _mbslwr(Name);\r
 \r
                                                LvItem.state = 0;\r
-                                               if(((FindMode == 0) && (CheckFname(Name, RegExp) == SUCCESS)) ||\r
+                                               if(((FindMode == 0) && (CheckFname(Name, RegExp) == FFFTP_SUCCESS)) ||\r
                                                   ((FindMode != 0) && (JreGetStrMatchInfo(Name, 0) != NULL)))\r
                                                {\r
                                                        LvItem.mask = LVIF_STATE;\r
@@ -1900,7 +2036,7 @@ void FindFileInList(HWND hWnd, int Type)
                                _mbslwr(Name);\r
 \r
                                LvItem.state = 0;\r
-                               if(((FindMode == 0) && (CheckFname(Name, RegExp) == SUCCESS)) ||\r
+                               if(((FindMode == 0) && (CheckFname(Name, RegExp) == FFFTP_SUCCESS)) ||\r
                                   ((FindMode != 0) && (JreGetStrMatchInfo(Name, 0) != NULL)))\r
                                {\r
                                        LvItem.mask = LVIF_STATE;\r
@@ -1920,13 +2056,13 @@ void FindFileInList(HWND hWnd, int Type)
 \r
 \r
 #if 0\r
-/*----- \83\8f\83C\83\8b\83h\83J\81[\83h\82ð\90³\8bK\95\\8c»\82É\95Ï\8a·\82·\82é ------------------------------------\r
+/*----- ワイルドカードを正規表現に変換する ------------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
+*              char *Str : 文字列\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void WildCard2RegExp(char *Str)\r
@@ -1986,13 +2122,13 @@ void WildCard2RegExp(char *Str)
 #endif\r
 \r
 \r
-/*----- \83J\81[\83\\83\8b\88Ê\92u\82Ì\83A\83C\83e\83\80\94Ô\8d\86\82ð\95Ô\82· --------------------------------------\r
+/*----- カーソル位置のアイテム番号を返す --------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
 *\r
 *      Return Value\r
-*              int \83A\83C\83e\83\80\94Ô\8d\86\r
+*              int アイテム番号\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetCurrentItem(int Win)\r
@@ -2011,13 +2147,13 @@ int GetCurrentItem(int Win)
 }\r
 \r
 \r
-/*----- \83A\83C\83e\83\80\90\94\82ð\95Ô\82· ------------------------------------------------------\r
+/*----- アイテム数を返す ------------------------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
 *\r
 *      Return Value\r
-*              int \83A\83C\83e\83\80\90\94\r
+*              int アイテム数\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetItemCount(int Win)\r
@@ -2032,13 +2168,13 @@ int GetItemCount(int Win)
 }\r
 \r
 \r
-/*----- \91I\91ð\82³\82ê\82Ä\82¢\82é\83A\83C\83e\83\80\90\94\82ð\95Ô\82· ----------------------------------------\r
+/*----- 選択されているアイテム数を返す ----------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
 *\r
 *      Return Value\r
-*              int \91I\91ð\82³\82ê\82Ä\82¢\82é\83A\83C\83e\83\80\90\94\r
+*              int 選択されているアイテム数\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetSelectedCount(int Win)\r
@@ -2053,15 +2189,15 @@ int GetSelectedCount(int Win)
 }\r
 \r
 \r
-/*----- \91I\91ð\82³\82ê\82Ä\82¢\82é\8dÅ\8f\89\82Ì\83A\83C\83e\83\80\94Ô\8d\86\82ð\95Ô\82· --------------------------------\r
+/*----- 選択されている最初のアイテム番号を返す --------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
-*              int All : \91I\82Î\82ê\82Ä\82¢\82È\82¢\82à\82Ì\82ð\8aÜ\82ß\82é\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
+*              int All : 選ばれていないものを含める\r
 *\r
 *      Return Value\r
-*              int \83A\83C\83e\83\80\94Ô\8d\86\r
-*                      -1 = \91I\91ð\82³\82ê\82Ä\82¢\82È\82¢\r
+*              int アイテム番号\r
+*                      -1 = 選択されていない\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetFirstSelected(int Win, int All)\r
@@ -2081,16 +2217,16 @@ int GetFirstSelected(int Win, int All)
 }\r
 \r
 \r
-/*----- \91I\91ð\82³\82ê\82Ä\82¢\82é\8e\9f\82Ì\83A\83C\83e\83\80\94Ô\8d\86\82ð\95Ô\82· ----------------------------------\r
+/*----- 選択されている次のアイテム番号を返す ----------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83B\83\93\83h\83E\94Ô\8d\86 (WIN_xxxx)\r
-*              int Pos : \8d¡\82Ì\83A\83C\83e\83\80\94Ô\8d\86\r
-*              int All : \91I\82Î\82ê\82Ä\82¢\82È\82¢\82à\82Ì\82à\8aÜ\82ß\82é\r
+*              int Win : ウィンドウ番号 (WIN_xxxx)\r
+*              int Pos : 今のアイテム番号\r
+*              int All : 選ばれていないものも含める\r
 *\r
 *      Return Value\r
-*              int \83A\83C\83e\83\80\94Ô\8d\86\r
-*                      -1 = \91I\91ð\82³\82ê\82Ä\82¢\82È\82¢\r
+*              int アイテム番号\r
+*                      -1 = 選択されていない\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetNextSelected(int Win, int Pos, int All)\r
@@ -2110,15 +2246,15 @@ int GetNextSelected(int Win, int Pos, int All)
 }\r
 \r
 \r
-/*----- \8ew\92è\82³\82ê\82½\96¼\91O\82Ì\83A\83C\83e\83\80\82ð\92T\82· ----------------------------------------\r
+/*----- 指定された名前のアイテムを探す ----------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              char *Name : \96¼\91O\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              char *Name : 名前\r
 *\r
 *      Return Value\r
-*              int \83A\83C\83e\83\80\94Ô\8d\86\r
-*                      -1=\8c©\82Â\82©\82ç\82È\82©\82Á\82½\r
+*              int アイテム番号\r
+*                      -1=見つからなかった\r
 *----------------------------------------------------------------------------*/\r
 \r
 int FindNameNode(int Win, char *Name)\r
@@ -2136,16 +2272,16 @@ int FindNameNode(int Win, char *Name)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\96¼\91O\82ð\95Ô\82· ----------------------------------------\r
+/*----- 指定位置のアイテムの名前を返す ----------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
-*              char *Buf : \96¼\91O\82ð\95Ô\82·\83o\83b\83t\83@\r
-*              int Max : \83o\83b\83t\83@\82Ì\83T\83C\83Y\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
+*              char *Buf : 名前を返すバッファ\r
+*              int Max : バッファのサイズ\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void GetNodeName(int Win, int Pos, char *Buf, int Max)\r
@@ -2167,16 +2303,16 @@ void GetNodeName(int Win, int Pos, char *Buf, int Max)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\93ú\95t\82ð\95Ô\82· ----------------------------------------\r
+/*----- 指定位置のアイテムの日付を返す ----------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
-*              FILETIME *Buf : \93ú\95t\82ð\95Ô\82·\83o\83b\83t\83@\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
+*              FILETIME *Buf : 日付を返すバッファ\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      YES/NO=\93ú\95t\8fî\95ñ\82ª\82È\82©\82Á\82½\r
+*              int ステータス\r
+*                      YES/NO=日付情報がなかった\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetNodeTime(int Win, int Pos, FILETIME *Buf)\r
@@ -2201,16 +2337,16 @@ int GetNodeTime(int Win, int Pos, FILETIME *Buf)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\83T\83C\83Y\82ð\95Ô\82· --------------------------------------\r
+/*----- 指定位置のアイテムのサイズを返す --------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
-*              int *Buf : \83T\83C\83Y\82ð\95Ô\82·\83\8f\81[\83N\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
+*              int *Buf : サイズを返すワーク\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      YES/NO=\83T\83C\83Y\8fî\95ñ\82ª\82È\82©\82Á\82½\r
+*              int ステータス\r
+*                      YES/NO=サイズ情報がなかった\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetNodeSize(int Win, int Pos, LONGLONG *Buf)\r
@@ -2232,6 +2368,13 @@ int GetNodeSize(int Win, int Pos, LONGLONG *Buf)
        SendMessage(hWnd, LVM_GETITEM, 0, (LPARAM)&LvItem);\r
        *Buf = -1;\r
        Ret = NO;\r
+#if defined(HAVE_TANDEM)\r
+       if(AskHostType() == HTYPE_TANDEM) {\r
+               RemoveComma(Tmp);\r
+               *Buf = _atoi64(Tmp);\r
+               Ret = YES;\r
+       } else\r
+#endif\r
        if(strlen(Tmp) > 0)\r
        {\r
                RemoveComma(Tmp);\r
@@ -2242,16 +2385,16 @@ int GetNodeSize(int Win, int Pos, LONGLONG *Buf)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\91®\90«\82ð\95Ô\82· ----------------------------------------\r
+/*----- 指定位置のアイテムの属性を返す ----------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
-*              int *Buf : \91®\90«\82ð\95Ô\82·\83\8f\81[\83N\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
+*              int *Buf : 属性を返すワーク\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      YES/NO=\83T\83C\83Y\8fî\95ñ\82ª\82È\82©\82Á\82½\r
+*              int ステータス\r
+*                      YES/NO=サイズ情報がなかった\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetNodeAttr(int Win, int Pos, int *Buf)\r
@@ -2266,12 +2409,22 @@ int GetNodeAttr(int Win, int Pos, int *Buf)
        {\r
                LvItem.mask = LVIF_TEXT;\r
                LvItem.iItem = Pos;\r
+#if defined(HAVE_TANDEM)\r
+               if(AskHostType() == HTYPE_TANDEM)\r
+                       LvItem.iSubItem = 3;\r
+               else\r
+#endif\r
                LvItem.iSubItem = 4;\r
                LvItem.pszText = Tmp;\r
                LvItem.cchTextMax = 20;\r
                SendMessage(GetRemoteHwnd(), LVM_GETITEM, 0, (LPARAM)&LvItem);\r
                if(strlen(Tmp) > 0)\r
                {\r
+#if defined(HAVE_TANDEM)\r
+                       if(AskHostType() == HTYPE_TANDEM)\r
+                               *Buf = atoi(Tmp);\r
+                       else\r
+#endif\r
                        *Buf = AttrString2Value(Tmp);\r
                        Ret = YES;\r
                }\r
@@ -2280,14 +2433,14 @@ int GetNodeAttr(int Win, int Pos, int *Buf)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\83^\83C\83v\82ð\95Ô\82· --------------------------------------\r
+/*----- 指定位置のアイテムのタイプを返す --------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
 *\r
 *      Return Value\r
-*              int \83^\83C\83v (NODE_xxx)\r
+*              int タイプ (NODE_xxx)\r
 *----------------------------------------------------------------------------*/\r
 \r
 int GetNodeType(int Win, int Pos)\r
@@ -2319,16 +2472,16 @@ int GetNodeType(int Win, int Pos)
 }\r
 \r
 \r
-/*----- \8ew\92è\88Ê\92u\82Ì\83A\83C\83e\83\80\82Ì\83I\81[\83i\96¼\82ð\95Ô\82· ------------------------------------\r
+/*----- 指定位置のアイテムのオーナ名を返す ------------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Pos : \88Ê\92u\r
-*              char *Buf : \83I\81[\83i\96¼\82ð\95Ô\82·\83o\83b\83t\83@\r
-*              int Max : \83o\83b\83t\83@\82Ì\83T\83C\83Y\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Pos : 位置\r
+*              char *Buf : オーナ名を返すバッファ\r
+*              int Max : バッファのサイズ\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void GetNodeOwner(int Win, int Pos, char *Buf, int Max)\r
@@ -2349,13 +2502,13 @@ void GetNodeOwner(int Win, int Pos, char *Buf, int Max)
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\83E\83C\83\93\83h\83E\82ð\83N\83\8a\83A ------------------------------\r
+/*----- ホスト側のファイル一覧ウインドウをクリア ------------------------------\r
 *\r
 *      Parameter\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void EraseRemoteDirForWnd(void)\r
@@ -2366,13 +2519,13 @@ void EraseRemoteDirForWnd(void)
 }\r
 \r
 \r
-/*----- \91I\91ð\82³\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82Ì\91\8d\83T\83C\83Y\82ð\95Ô\82· --------------------------------\r
+/*----- 選択されているファイルの総サイズを返す --------------------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
 *\r
 *      Return Value\r
-*              double \83T\83C\83Y\r
+*              double サイズ\r
 *----------------------------------------------------------------------------*/\r
 \r
 double GetSelectedTotalSize(int Win)\r
@@ -2404,16 +2557,16 @@ double GetSelectedTotalSize(int Win)
 \r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ð\83\8a\83X\83g\82É\93o\98^\82·\82é ------------------\r
+/*----- ファイル一覧で選ばれているファイルをリストに登録する ------------------\r
 *\r
 *      Parameter\r
-*              int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
-*              int Expand : \83T\83u\83f\83B\83\8c\83N\83g\83\8a\82ð\93W\8aJ\82·\82é (YES/NO)\r
-*              int All : \91I\82Î\82ê\82Ä\82¢\82È\82¢\82à\82Ì\82à\82·\82×\82Ä\93o\98^\82·\82é (YES/NO)\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              int Win : ウインドウ番号 (WIN_xxx)\r
+*              int Expand : サブディレクトリを展開する (YES/NO)\r
+*              int All : 選ばれていないものもすべて登録する (YES/NO)\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *CancelCheckWork)\r
@@ -2428,7 +2581,7 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
 \r
        if((All == YES) || (GetSelectedCount(Win) > 0))\r
        {\r
-               /*===== \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82Ì\83t\83@\83C\83\8b =====*/\r
+               /*===== カレントディレクトリのファイル =====*/\r
 \r
                Pos = GetFirstSelected(Win, All);\r
                while(Pos != -1)\r
@@ -2466,7 +2619,7 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
 \r
                if(Expand == YES)\r
                {\r
-                       /*===== \83f\83B\83\8c\83N\83g\83\8a\83c\83\8a\81[ =====*/\r
+                       /*===== ディレクトリツリー =====*/\r
 \r
                        Pos = GetFirstSelected(Win, All);\r
                        while(Pos != -1)\r
@@ -2523,8 +2676,8 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
 }\r
 \r
 \r
-/* \83f\83o\83b\83O\97p */\r
-/* \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\93à\97e\82ð\95\\8e¦ */\r
+/* デバッグ用 */\r
+/* ファイルリストの内容を表示 */\r
 static void DispListList(FILELIST *Pos, char *Title)\r
 {\r
        DoPrintf("############ %s ############", Title);\r
@@ -2538,15 +2691,15 @@ static void DispListList(FILELIST *Pos, char *Title)
 }\r
 \r
 \r
-/*----- Drag&Drop\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83\8a\83X\83g\82É\93o\98^\82·\82é -----------------------------\r
+/*----- Drag&Dropされたファイルをリストに登録する -----------------------------\r
 *\r
 *      Parameter\r
-*              WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
-*              char *Cur : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82ð\95Ô\82·\83o\83b\83t\83@\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              WPARAM wParam : ドロップされたファイルの情報\r
+*              char *Cur : カレントディレクトリを返すバッファ\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)\r
@@ -2574,10 +2727,19 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
                        strcpy(Pkt.File, GetFileName(Name));\r
 \r
                        memset(&Pkt.Time, 0, sizeof(FILETIME));\r
+#if defined(HAVE_TANDEM)\r
+                       /* Guardian スペースへのアップロードのためにサイズが必要 */\r
+                       Pkt.Size = 0;\r
+                       Pkt.InfoExist = 0;\r
+#endif\r
                        if((fHnd = FindFirstFile(Name, &Find)) != INVALID_HANDLE_VALUE)\r
                        {\r
                                FindClose(fHnd);\r
                                Pkt.Time = Find.ftLastWriteTime;\r
+#if defined(HAVE_TANDEM)\r
+                               Pkt.Size = MakeLongLong(Find.nFileSizeHigh, Find.nFileSizeLow);\r
+                               Pkt.InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
+#endif\r
                        }\r
                        AddFileList(&Pkt, Base);\r
                }\r
@@ -2606,14 +2768,14 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
 }\r
 \r
 \r
-/*----- Drag&Drop\82³\82ê\82½\83t\83@\83C\83\8b\82ª\82 \82é\83t\83H\83\8b\83_\82ð\8eæ\93¾\82·\82é -----------------------\r
+/*----- Drag&Dropされたファイルがあるフォルダを取得する -----------------------\r
 *\r
 *      Parameter\r
-*              WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
-*              char *Cur : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82ð\95Ô\82·\83o\83b\83t\83@\r
+*              WPARAM wParam : ドロップされたファイルの情報\r
+*              char *Cur : カレントディレクトリを返すバッファ\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void MakeDroppedDir(WPARAM wParam, char *Cur)\r
@@ -2629,18 +2791,18 @@ void MakeDroppedDir(WPARAM wParam, char *Cur)
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83T\83u\83f\83B\83\8c\83N\83g\83\8a\88È\89º\82Ì\83t\83@\83C\83\8b\82ð\83\8a\83X\83g\82É\93o\98^\82·\82é\81i\82P\81j-------\r
+/*----- ホスト側のサブディレクトリ以下のファイルをリストに登録する(1)-------\r
 *\r
 *      Parameter\r
-*              char *Path : \83p\83X\96¼\r
-*              char *Cur : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              char *Path : パス名\r
+*              char *Cur : カレントディレクトリ\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Note\r
-*              NLST -alLR \82ð\8eg\82¤\r
+*              NLST -alLR を使う\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void MakeRemoteTree1(char *Path, char *Cur, FILELIST **Base, int *CancelCheckWork)\r
@@ -2649,7 +2811,7 @@ static void MakeRemoteTree1(char *Path, char *Cur, FILELIST **Base, int *CancelC
 \r
        if(DoCWD(Path, NO, NO, NO) == FTP_COMPLETE)\r
        {\r
-               /* \83T\83u\83t\83H\83\8b\83_\82à\8aÜ\82ß\82½\83\8a\83X\83g\82ð\8eæ\93¾ */\r
+               /* サブフォルダも含めたリストを取得 */\r
                Sts = DoDirListCmdSkt("R", "", 999, CancelCheckWork);   /* NLST -alLR*/\r
                DoCWD(Cur, NO, NO, NO);\r
 \r
@@ -2660,18 +2822,18 @@ static void MakeRemoteTree1(char *Path, char *Cur, FILELIST **Base, int *CancelC
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83T\83u\83f\83B\83\8c\83N\83g\83\8a\88È\89º\82Ì\83t\83@\83C\83\8b\82ð\83\8a\83X\83g\82É\93o\98^\82·\82é\81i\82Q\81j-------\r
+/*----- ホスト側のサブディレクトリ以下のファイルをリストに登録する(2)-------\r
 *\r
 *      Parameter\r
-*              char *Path : \83p\83X\96¼\r
-*              char *Cur : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              char *Path : パス名\r
+*              char *Cur : カレントディレクトリ\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Note\r
-*              \8ae\83t\83H\83\8b\83_\82É\88Ú\93®\82µ\82Ä\83\8a\83X\83g\82ð\8eæ\93¾\r
+*              各フォルダに移動してリストを取得\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelCheckWork)\r
@@ -2681,14 +2843,14 @@ static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelC
        FILELIST *Pos;\r
        FILELIST Pkt;\r
 \r
-       /* VAX VMS \82Í CWD xxx/yyy \82Æ\82¢\82¤\8ew\92è\82ª\82Å\82«\82È\82¢\82Ì\82Å      */\r
-       /* CWD xxx, Cwd yyy \82Æ\95¡\90\94\82É\95ª\82¯\82é                                      */\r
+       /* VAX VMS は CWD xxx/yyy という指定ができないので */\r
+       /* CWD xxx, Cwd yyy と複数に分ける                                       */\r
        if(AskHostType() != HTYPE_VMS)\r
                Sts = DoCWD(Path, NO, NO, NO);\r
        else\r
        {\r
 #if defined(HAVE_OPENVMS)\r
-               /* OpenVMS\82Ì\8fê\8d\87\81A\83f\83B\83\8c\83N\83g\83\8a\88Ú\93®\8e\9e\82Í"HOGE.DIR;1"\82ð"HOGE"\82É\82·\82é */\r
+               /* OpenVMSの場合、ディレクトリ移動時は"HOGE.DIR;1"を"HOGE"にする */\r
                ReformVMSDirName(Path, TRUE);\r
 #endif\r
                Sts = DoCWDStepByStep(Path, Cur);\r
@@ -2710,7 +2872,7 @@ static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelC
                        {\r
                                if(Pos->Node == NODE_DIR)\r
                                {\r
-                                       /* \82Ü\82¸\83f\83B\83\8c\83N\83g\83\8a\96¼\82ð\83Z\83b\83g */\r
+                                       /* まずディレクトリ名をセット */\r
                                        strcpy(Pkt.File, Pos->File);\r
                                        Pkt.Node = NODE_DIR;\r
                                        Pkt.Size = 0;\r
@@ -2718,7 +2880,7 @@ static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelC
                                        memset(&Pkt.Time, 0, sizeof(FILETIME));\r
                                        AddFileList(&Pkt, Base);\r
 \r
-                                       /* \82»\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Ì\92\86\82ð\8c\9f\8dõ */\r
+                                       /* そのディレクトリの中を検索 */\r
                                        MakeRemoteTree2(Pos->File, Cur, Base, CancelCheckWork);\r
                                }\r
                                Pos = Pos->Next;\r
@@ -2730,18 +2892,18 @@ static void MakeRemoteTree2(char *Path, char *Cur, FILELIST **Base, int *CancelC
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\93à\97e\82ð\95Ê\82Ì\83t\83@\83C\83\8b\83\8a\83X\83g\82É\83R\83s\81[ ----------------------\r
+/*----- ファイルリストの内容を別のファイルリストにコピー ----------------------\r
 *\r
 *      Parameter\r
-*              FILELIST **Base : \83R\83s\81[\90æ\r
-*              FILELIST *List : \83R\83s\81[\8c³\r
+*              FILELIST **Base : コピー先\r
+*              FILELIST *List : コピー元\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *\r
 *      Note\r
-*              \83R\83s\81[\82·\82é\82Ì\82Í\83t\83@\83C\83\8b\82Ì\8fî\95ñ\82¾\82¯\r
-*              \83f\83B\83\8c\83N\83g\83\8a\82Ì\8fî\95ñ\82Í\83R\83s\81[\82µ\82È\82¢\r
+*              コピーするのはファイルの情報だけ\r
+*              ディレクトリの情報はコピーしない\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void CopyTmpListToFileList(FILELIST **Base, FILELIST *List)\r
@@ -2757,16 +2919,16 @@ static void CopyTmpListToFileList(FILELIST **Base, FILELIST *List)
 }\r
 \r
 \r
-/*----- \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\8fî\95ñ\82ð\83t\83@\83C\83\8b\83\8a\83X\83g\82É\93o\98^ --------------------------\r
+/*----- ホスト側のファイル情報をファイルリストに登録 --------------------------\r
 *\r
 *      Parameter\r
-*              int Num : \83e\83\93\83|\83\89\83\8a\83t\83@\83C\83\8b\82Ì\83t\83@\83C\83\8b\96¼\94Ô\8d\86 (_ffftp.???)\r
-*              char *Path : \83p\83X\96¼\r
-*              int IncDir : \8dÄ\8bA\8c\9f\8dõ\82Ì\95û\96@ (RDIR_xxx)\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              int Num : テンポラリファイルのファイル名番号 (_ffftp.???)\r
+*              char *Path : パス名\r
+*              int IncDir : 再帰検索の方法 (RDIR_xxx)\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)\r
@@ -2792,11 +2954,11 @@ void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)
 \r
                ListType = LIST_UNKNOWN;\r
 \r
-               while(GetListOneLine(Str, FMAX_PATH, fd) == SUCCESS)\r
+               while(GetListOneLine(Str, FMAX_PATH, fd) == FFFTP_SUCCESS)\r
                {\r
                        if((ListType = AnalizeFileInfo(Str)) == LIST_UNKNOWN)\r
                        {\r
-                               if(MakeDirPath(Str, ListType, Path, Dir) == SUCCESS)\r
+                               if(MakeDirPath(Str, ListType, Path, Dir) == FFFTP_SUCCESS)\r
                                {\r
                                        if(IncDir == RDIR_NLST)\r
                                        {\r
@@ -2839,19 +3001,19 @@ void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\88ê\97\97\8fî\95ñ\82Ì\82P\8ds\82ð\8eæ\93¾ ------------------------------------------\r
+/*----- ファイル一覧情報の1行を取得 ------------------------------------------\r
 *\r
 *      Parameter\r
-*              char *Buf : \82P\8ds\82Ì\8fî\95ñ\82ð\83Z\83b\83g\82·\82é\83o\83b\83t\83@\r
-*              int Max : \8dÅ\91å\95\8e\9a\90\94\r
-*              FILE *Fd : \83X\83g\83\8a\81[\83\80\r
+*              char *Buf : 1行の情報をセットするバッファ\r
+*              int Max : 最大文字数\r
+*              FILE *Fd : ストリーム\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X (SUCCESS/FAIL)\r
+*              int ステータス (FFFTP_SUCCESS/FFFTP_FAIL)\r
 *\r
 *      Note\r
-*              VAX VMS\88È\8aO\82Ì\8e\9e\82Í fgets(Buf, Max, Fd) \82Æ\93¯\82\r
-*              Vax VMS\82Ì\8e\9e\82Í\81A\95¡\90\94\8ds\82Ì\83t\83@\83C\83\8b\8fî\95ñ\82ð\82P\8ds\82É\82Ü\82Æ\82ß\82é\r
+*              VAX VMS以外の時は fgets(Buf, Max, Fd) と同じ\r
+*              Vax VMSの時は、複数行のファイル情報を1行にまとめる\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int GetListOneLine(char *Buf, int Max, FILE *Fd)\r
@@ -2859,19 +3021,19 @@ static int GetListOneLine(char *Buf, int Max, FILE *Fd)
        char Tmp[FMAX_PATH+1];\r
        int Sts;\r
 \r
-       Sts = FAIL;\r
-       while((Sts == FAIL) && (fgets(Buf, Max, Fd) != NULL))\r
+       Sts = FFFTP_FAIL;\r
+       while((Sts == FFFTP_FAIL) && (fgets(Buf, Max, Fd) != NULL))\r
        {\r
-               Sts = SUCCESS;\r
+               Sts = FFFTP_SUCCESS;\r
                RemoveReturnCode(Buf);\r
                ReplaceAll(Buf, '\x08', ' ');\r
 \r
-               /* VAX VMS\82Å\82Í\83t\83@\83C\83\8b\8fî\95ñ\82ª\95¡\90\94\8ds\82É\82í\82©\82ê\82Ä\82¢\82é        */\r
-               /* \82»\82ê\82ð\82P\8ds\82É\82Ü\82Æ\82ß\82é                                                         */\r
+               /* VAX VMSではファイル情報が複数行にわかれている     */\r
+               /* それを1行にまとめる                                                               */\r
                if(AskHostType() == HTYPE_VMS)\r
                {\r
-                       if(strchr(Buf, ';') == NULL)    /* \83t\83@\83C\83\8b\96¼\88È\8aO\82Ì\8ds */\r
-                               Sts = FAIL;\r
+                       if(strchr(Buf, ';') == NULL)    /* ファイル名以外の行 */\r
+                               Sts = FFFTP_FAIL;\r
                        else\r
                        {\r
                                Max -= strlen(Buf);\r
@@ -2899,24 +3061,24 @@ static int GetListOneLine(char *Buf, int Max, FILE *Fd)
 }\r
 \r
 \r
-/*----- \83T\83u\83f\83B\83\8c\83N\83g\83\8a\8fî\95ñ\82Ì\89ð\90Í --------------------------------------------\r
+/*----- サブディレクトリ情報の解析 --------------------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \83t\83@\83C\83\8b\8fî\95ñ\81i\82P\8ds\81j\r
-*              int ListType : \83\8a\83X\83g\82Ì\83^\83C\83v\r
-*              char *Path : \90æ\93ª\82©\82ç\82Ì\83p\83X\96¼\r
-*              char *Dir : \83f\83B\83\8c\83N\83g\83\8a\96¼\r
+*              char *Str : ファイル情報(1行)\r
+*              int ListType : リストのタイプ\r
+*              char *Path : 先頭からのパス名\r
+*              char *Dir : ディレクトリ名\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      SUCCESS/FAIL=\83f\83B\83\8c\83N\83g\83\8a\8fî\95ñ\82Å\82È\82¢\r
+*              int ステータス\r
+*                      FFFTP_SUCCESS/FFFTP_FAIL=ディレクトリ情報でない\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int MakeDirPath(char *Str, int ListType, char *Path, char *Dir)\r
 {\r
        int Sts;\r
 \r
-       Sts = FAIL;\r
+       Sts = FFFTP_FAIL;\r
        switch(ListType)\r
        {\r
                case LIST_ACOS :\r
@@ -2924,7 +3086,7 @@ static int MakeDirPath(char *Str, int ListType, char *Path, char *Dir)
                        break;\r
 \r
                default:\r
-                       if(*(Str + strlen(Str) - 1) == ':')             /* \8dÅ\8cã\82ª : \82È\82ç\83T\83u\83f\83B\83\8c\83N\83g\83\8a */\r
+                       if(*(Str + strlen(Str) - 1) == ':')             /* 最後が : ならサブディレクトリ */\r
                        {\r
                                if(strcmp(Str, ".:") != 0)\r
                                {\r
@@ -2946,7 +3108,7 @@ static int MakeDirPath(char *Str, int ListType, char *Path, char *Dir)
                                                ReplaceAll(Dir, '\\', '/');\r
                                        }\r
                                }\r
-                               Sts = SUCCESS;\r
+                               Sts = FFFTP_SUCCESS;\r
                        }\r
                        break;\r
        }\r
@@ -2954,14 +3116,14 @@ static int MakeDirPath(char *Str, int ListType, char *Path, char *Dir)
 }\r
 \r
 \r
-/*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83T\83u\83f\83B\83\8c\83N\83g\83\8a\88È\89º\82Ì\83t\83@\83C\83\8b\82ð\83\8a\83X\83g\82É\93o\98^\82·\82é ----------\r
+/*----- ローカル側のサブディレクトリ以下のファイルをリストに登録する ----------\r
 *\r
 *      Parameter\r
-*              char *Path : \83p\83X\96¼\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              char *Path : パス名\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void MakeLocalTree(char *Path, FILELIST **Base)\r
@@ -3034,14 +3196,14 @@ static void MakeLocalTree(char *Path, FILELIST **Base)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\82É\8fî\95ñ\82ð\93o\98^\82·\82é ----------------------------------------\r
+/*----- ファイルリストに情報を登録する ----------------------------------------\r
 *\r
 *      Parameter\r
-*              FILELIST *Pkt : \93o\98^\82·\82é\83t\83@\83C\83\8b\8fî\95ñ\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              FILELIST *Pkt : 登録するファイル情報\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void AddFileList(FILELIST *Pkt, FILELIST **Base)\r
@@ -3051,7 +3213,7 @@ static void AddFileList(FILELIST *Pkt, FILELIST **Base)
 \r
        DoPrintf("FileList : NODE=%d : %s", Pkt->Node, Pkt->File);\r
 \r
-       /* \83\8a\83X\83g\82Ì\8fd\95¡\82ð\8eæ\82è\8f\9c\82­ */\r
+       /* リストの重複を取り除く */\r
        Pos = *Base;\r
        while(Pos != NULL)\r
        {\r
@@ -3064,7 +3226,7 @@ static void AddFileList(FILELIST *Pkt, FILELIST **Base)
                Pos = Pos->Next;\r
        }\r
 \r
-       if(Pos == NULL)         /* \8fd\95¡\82µ\82Ä\82¢\82È\82¢\82Ì\82Å\93o\98^\82·\82é */\r
+       if(Pos == NULL)         /* 重複していないので登録する */\r
        {\r
                if((Pos = malloc(sizeof(FILELIST))) != NULL)\r
                {\r
@@ -3081,13 +3243,13 @@ static void AddFileList(FILELIST *Pkt, FILELIST **Base)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\82ð\83N\83\8a\83A\82·\82é --------------------------------------------\r
+/*----- ファイルリストをクリアする --------------------------------------------\r
 *\r
 *      Parameter\r
-*              FILELIST **Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
+*              FILELIST **Base : ファイルリストの先頭\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 void DeleteFileList(FILELIST **Base)\r
@@ -3107,16 +3269,16 @@ void DeleteFileList(FILELIST **Base)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\83\8a\83X\83g\82É\8ew\92è\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\82©\83`\83F\83b\83N ------------------------\r
+/*----- ファイルリストに指定のファイルがあるかチェック ------------------------\r
 *\r
 *      Parameter\r
-*              char *Fname : \83t\83@\83C\83\8b\96¼\r
-*              FILELIST *Base : \83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\90æ\93ª\r
-*              int Caps : \91å\95\8e\9a/\8f¬\95\8e\9a\82Ì\8bæ\95Ê\83\82\81[\83h (COMP_xxx)\r
+*              char *Fname : ファイル名\r
+*              FILELIST *Base : ファイルリストの先頭\r
+*              int Caps : 大文字/小文字の区別モード (COMP_xxx)\r
 *\r
 *      Return Value\r
-*              FILELIST *\8c©\82Â\82©\82Á\82½\83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\83f\81[\83^\r
-*                      NULL=\8c©\82Â\82©\82ç\82È\82¢\r
+*              FILELIST *見つかったファイルリストのデータ\r
+*                      NULL=見つからない\r
 *----------------------------------------------------------------------------*/\r
 \r
 FILELIST *SearchFileList(char *Fname, FILELIST *Base, int Caps)\r
@@ -3151,13 +3313,13 @@ FILELIST *SearchFileList(char *Fname, FILELIST *Base, int Caps)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\8fî\95ñ\82©\82ç\83\8a\83X\83g\83^\83C\83v\82ð\8b\81\82ß\82é ----------------------------------\r
+/*----- ファイル情報からリストタイプを求める ----------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \83t\83@\83C\83\8b\8fî\95ñ\81i\82P\8ds\81j\r
+*              char *Str : ファイル情報(1行)\r
 *\r
 *      Return Value\r
-*              int \83\8a\83X\83g\83^\83C\83v (LIST_xxx)\r
+*              int リストタイプ (LIST_xxx)\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int AnalizeFileInfo(char *Str)\r
@@ -3190,17 +3352,17 @@ static int AnalizeFileInfo(char *Str)
                Ret = LIST_SHIBASOKU;\r
        else\r
        {\r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_UNIX_10, LIST_UNIX_20, LIST_UNIX_12, LIST_UNIX_22, LIST_UNIX_50, LIST_UNIX_60 */\r
                /* MELCOM80 */\r
 \r
-               if(FindField(Str, Tmp, 0, NO) == SUCCESS)\r
+               if(FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS)\r
                {\r
-                       /* MELCOM80\82Í "d rwxrwxrwx" \82Ì\82æ\82¤\82É\83X\83y\81[\83X\82ª\8bó\82¢\82Ä\82¢\82é */\r
+                       /* MELCOM80は "d rwxrwxrwx" のようにスペースが空いている */\r
                        Flag1 = NO;\r
                        if((strlen(Tmp) == 1) && (strchr("-dDlL", Tmp[0]) != NULL))\r
                        {\r
-                               if(FindField(Str, Tmp, 1, NO) == SUCCESS)\r
+                               if(FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS)\r
                                {\r
                                        if((strlen(Tmp) == 9) ||\r
                                           ((strlen(Tmp) > 9) && (IsDigit(Tmp[9]) != 0)))\r
@@ -3217,14 +3379,14 @@ static int AnalizeFileInfo(char *Str)
                                Add1 = 0;\r
                                if((strlen(Tmp) > 10) && (IsDigit(Tmp[10]) != 0))\r
                                {\r
-                                       /* \82±\82¤\82¢\82¤\8e\9e */\r
+                                       /* こういう時 */\r
                                        /*   drwxr-xr-x1234  owner group  1024  Nov 6 14:21 Linux/    */\r
                                        Add1 = -1;\r
                                }\r
 \r
 ////////////\r
 // LIST_UNIX_60 support\r
-                               if(FindField(Str, Tmp, 7+Add1, NO) == SUCCESS)\r
+                               if(FindField(Str, Tmp, 7+Add1, NO) == FFFTP_SUCCESS)\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3237,7 +3399,7 @@ static int AnalizeFileInfo(char *Str)
 ////////////\r
 // LIST_UNIX_12 support\r
                                if((Ret == LIST_UNKNOWN) &&\r
-                                  (FindField(Str, Tmp, 6+Add1, NO) == SUCCESS))\r
+                                  (FindField(Str, Tmp, 6+Add1, NO) == FFFTP_SUCCESS))\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3250,7 +3412,7 @@ static int AnalizeFileInfo(char *Str)
 ////////////\r
 // LIST_UNIX_70 support\r
                                if((Ret == LIST_UNKNOWN) &&\r
-                                  (FindField(Str, Tmp, 6+Add1, NO) == SUCCESS))\r
+                                  (FindField(Str, Tmp, 6+Add1, NO) == FFFTP_SUCCESS))\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3261,7 +3423,7 @@ static int AnalizeFileInfo(char *Str)
 ///////////\r
 \r
                                if((Ret == LIST_UNKNOWN) &&\r
-                                  (FindField(Str, Tmp, 5+Add1, NO) == SUCCESS))\r
+                                  (FindField(Str, Tmp, 5+Add1, NO) == FFFTP_SUCCESS))\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3271,7 +3433,7 @@ static int AnalizeFileInfo(char *Str)
                                }\r
 \r
                                if((Ret == LIST_UNKNOWN) &&\r
-                                  (FindField(Str, Tmp, 4+Add1, NO) == SUCCESS))\r
+                                  (FindField(Str, Tmp, 4+Add1, NO) == FFFTP_SUCCESS))\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3281,7 +3443,7 @@ static int AnalizeFileInfo(char *Str)
                                }\r
 \r
                                if((Ret == LIST_UNKNOWN) &&\r
-                                  (FindField(Str, Tmp, 3+Add1, NO) == SUCCESS))\r
+                                  (FindField(Str, Tmp, 3+Add1, NO) == FFFTP_SUCCESS))\r
                                {\r
                                        GetMonth(Tmp, &Month, &Day);\r
                                        if(Month != 0)\r
@@ -3290,26 +3452,41 @@ static int AnalizeFileInfo(char *Str)
                                        }\r
                                }\r
 \r
+                               // linux-ftpd\r
+                               if((Ret == LIST_UNKNOWN) &&\r
+                                  (FindField(Str, Tmp, 7+Add1, NO) == FFFTP_SUCCESS))\r
+                               {\r
+                                       if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
+                                          (CheckYYYYMMDDformat(Tmp, NUL) != 0))\r
+                                       {\r
+                                               if((FindField(Str, Tmp, 6, NO) == FFFTP_SUCCESS) &&\r
+                                                  (CheckHHMMformat(Tmp) == YES))\r
+                                               {\r
+                                                       Ret = LIST_UNIX_16;\r
+                                               }\r
+                                       }\r
+                               }\r
+\r
                                if((Ret != LIST_UNKNOWN) && (Flag1 == YES))\r
                                        Ret |= LIST_MELCOM;\r
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_AS400 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                        {\r
-                               if((FindField(Str, Tmp, 3, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS) &&\r
                                   (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                                           (IsDigit(Tmp[0]) != 0))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 5, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_AS400;\r
                                                }\r
@@ -3318,24 +3495,24 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_M1800 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 5, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYMMDDformat(Tmp, '*', NO) != 0))\r
                        {\r
-                               if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                   ((IsDigit(Tmp[0]) != 0) || (StrAllSameChar(Tmp, '*') == YES)))\r
                                {\r
-                                       if((FindField(Str, Tmp, 3, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS) &&\r
                                           ((IsDigit(Tmp[0]) != 0) || (StrAllSameChar(Tmp, '*') == YES)))\r
                                        {\r
-                                               if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                                               if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                                                   (strlen(Tmp) == 4))\r
                                                {\r
-                                                       if(FindField(Str, Tmp, 6, NO) == SUCCESS)\r
+                                                       if(FindField(Str, Tmp, 6, NO) == FFFTP_SUCCESS)\r
                                                        {\r
                                                                Ret = LIST_M1800;\r
                                                        }\r
@@ -3345,21 +3522,21 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_GP6000 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                        {\r
-                               if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                   (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 5, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
                                           (IsDigit(Tmp[0]) != 0))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 6, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 6, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_GP6000;\r
                                                }\r
@@ -3368,20 +3545,20 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_DOS_1, LIST_DOS_2 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                           (CheckHHMMformat(Tmp) == YES))\r
                        {\r
-                               if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                   ((Tmp[0] == '<') || (IsDigit(Tmp[0]) != 0)))\r
                                {\r
-                                       if(FindField(Str, Tmp, 3, NO) == SUCCESS)\r
+                                       if(FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS)\r
                                        {\r
-                                               if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                                               if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                                                   (CheckYYMMDDformat(Tmp, NUL, YES) != 0))\r
                                                {\r
                                                        TmpInt = atoi(Tmp);\r
@@ -3395,18 +3572,18 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_DOS_3 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 3, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS) &&\r
                           (CheckHHMMformat(Tmp) == YES))\r
                        {\r
-                               if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                                   ((Tmp[0] == '<') || (IsDigit(Tmp[0]) != 0)))\r
                                {\r
-                                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                           (CheckYYMMDDformat(Tmp, NUL, YES) != 0))\r
                                        {\r
                                                Ret = LIST_DOS_3;\r
@@ -3415,21 +3592,21 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_DOS_4 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYYYMMDDformat(Tmp, NUL) == YES))\r
                        {\r
-                               if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                                   (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                           ((Tmp[0] == '<') || (IsDigit(Tmp[0]) != 0)))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 3, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_DOS_4;\r
                                                }\r
@@ -3438,20 +3615,20 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_CHAMELEON */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if(FindField(Str, Tmp, 2, NO) == SUCCESS)\r
+                       if(FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS)\r
                        {\r
                                GetMonth(Tmp, &Month, &Day);\r
                                if((Month != 0) && (Day == 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                                           ((Tmp[0] == '<') || (IsDigit(Tmp[0]) != 0)))\r
                                        {\r
-                                               if((FindField(Str, Tmp, 5, NO) == SUCCESS) &&\r
+                                               if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
                                                   (CheckHHMMformat(Tmp) == YES))\r
                                                {\r
                                                        Ret = LIST_CHAMELEON;\r
@@ -3461,21 +3638,21 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_OS2 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 3, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS) &&\r
                           (CheckHHMMformat(Tmp) == YES))\r
                        {\r
-                               if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                                   (IsDigit(Tmp[0]) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                           (CheckYYMMDDformat(Tmp, NUL, YES) != 0))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 4, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 4, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_OS2;\r
                                                }\r
@@ -3484,37 +3661,37 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_OS7 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                           (strlen(Tmp) == 10))\r
                        {\r
-                               if((FindField(Str, Tmp, 3, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS) &&\r
                                   (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 4, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 4, NO) == FFFTP_SUCCESS) &&\r
                                           (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                        {\r
-                                               if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                                               if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                                   (IsDigit(Tmp[0]) != 0))\r
                                                {\r
-                                                       if(FindField(Str, Tmp, 5, NO) == SUCCESS)\r
+                                                       if(FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS)\r
                                                        {\r
                                                                Ret = LIST_OS7_2;\r
                                                        }\r
                                                }\r
                                        }\r
                                }\r
-                               else if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                               else if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                                                (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                {\r
-                                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                           (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 3, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_OS7_1;\r
                                                }\r
@@ -3523,23 +3700,23 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_ALLIED */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 0, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 0, NO) == FFFTP_SUCCESS) &&\r
                           ((Tmp[0] == '<') || (IsDigit(Tmp[0]) != 0)))\r
                        {\r
-                               if((FindField(Str, Tmp, 5, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
                                   (CheckHHMMformat(Tmp) == YES))\r
                                {\r
-                                       if(FindField(Str, Tmp, 3, NO) == SUCCESS)\r
+                                       if(FindField(Str, Tmp, 3, NO) == FFFTP_SUCCESS)\r
                                        {\r
                                                GetMonth(Tmp, &Month, &Day);\r
                                                if(Month != 0)\r
                                                {\r
-                                                       if((FindField(Str, Tmp, 6, NO) == SUCCESS) &&\r
+                                                       if((FindField(Str, Tmp, 6, NO) == FFFTP_SUCCESS) &&\r
                                                           (IsDigit(Tmp[0]) != 0))\r
                                                        {\r
                                                                Ret = LIST_ALLIED;\r
@@ -3550,21 +3727,21 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_OS9 */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 1, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYMMDDformat(Tmp, NUL, NO) != 0))\r
                        {\r
-                               if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                                   (IsDigit(Tmp[0]) != 0) && (strlen(Tmp) == 4))\r
                                {\r
-                                       if((FindField(Str, Tmp, 5, NO) == SUCCESS) &&\r
+                                       if((FindField(Str, Tmp, 5, NO) == FFFTP_SUCCESS) &&\r
                                           (IsDigit(Tmp[0]) != 0))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 6, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 6, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_OS9;\r
                                                }\r
@@ -3573,19 +3750,19 @@ static int AnalizeFileInfo(char *Str)
                        }\r
                }\r
 \r
-               /* \88È\89º\82Ì\83t\83H\81[\83}\83b\83g\82ð\83`\83F\83b\83N */\r
+               /* 以下のフォーマットをチェック */\r
                /* LIST_IBM */\r
 \r
                if(Ret == LIST_UNKNOWN)\r
                {\r
-                       if((FindField(Str, Tmp, 2, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 2, NO) == FFFTP_SUCCESS) &&\r
                           (CheckYYYYMMDDformat(Tmp, NUL) == YES))\r
                        {\r
-                               if((FindField(Str, Tmp, 1, NO) == SUCCESS) && IsDigit(Tmp[0]))\r
+                               if((FindField(Str, Tmp, 1, NO) == FFFTP_SUCCESS) && IsDigit(Tmp[0]))\r
                                {\r
-                                       if((FindField(Str, Tmp, 7, NO) == SUCCESS) && IsDigit(Tmp[0]))\r
+                                       if((FindField(Str, Tmp, 7, NO) == FFFTP_SUCCESS) && IsDigit(Tmp[0]))\r
                                        {\r
-                                               if(FindField(Str, Tmp, 9, NO) == SUCCESS)\r
+                                               if(FindField(Str, Tmp, 9, NO) == FFFTP_SUCCESS)\r
                                                {\r
                                                        Ret = LIST_IBM;\r
                                                }\r
@@ -3593,7 +3770,29 @@ static int AnalizeFileInfo(char *Str)
                                }\r
                        }\r
                }\r
+#if defined(HAVE_TANDEM)\r
+               /* 以下のフォーマットをチェック */\r
+               /* LIST_TANDEM */\r
+\r
+               /* OSS の場合は自動判別可能のため Ret == LIST_UNKNOWN のチェックは後 */\r
+               if(AskRealHostType() == HTYPE_TANDEM) {\r
+                       if(Ret == LIST_UNKNOWN) {\r
+                               SetOSS(NO);\r
+                               Ret = LIST_TANDEM;\r
+                       } else {\r
+                               SetOSS(YES);\r
+                       }\r
+               }\r
+#endif\r
 \r
+               // MLSD対応\r
+               if(Ret == LIST_UNKNOWN)\r
+               {\r
+                       if(FindField2(Str, Tmp, ';', 1, NO) == FFFTP_SUCCESS && FindField2(Str, Tmp, '=', 1, NO) == FFFTP_SUCCESS)\r
+                       {\r
+                               Ret = LIST_MLSD;\r
+                       }\r
+               }\r
        }\r
 \r
 DoPrintf("ListType=%d", Ret);\r
@@ -3602,17 +3801,17 @@ DoPrintf("ListType=%d", Ret);
 }\r
 \r
 \r
-/*----- UNIX\8cn\83\8a\83X\83g\83^\83C\83v\82Ì\83`\83F\83b\83N\82ð\8ds\82È\82¤ ----------------------------------\r
+/*----- UNIX系リストタイプのチェックを行なう ----------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \83t\83@\83C\83\8b\8fî\95ñ\81i\82P\8ds\81j\r
-*              char *Tmp : \88ê\8e\9e\83\8f\81[\83N\r
-*              int Add1 : \89Á\8eZ\83p\83\89\83\81\81[\83^1\r
-*              int Add2 : \89Á\8eZ\83p\83\89\83\81\81[\83^2\r
-*              int Day : \93ú (0=\82±\82±\82Å\8eæ\93¾\82·\82é)\r
+*              char *Str : ファイル情報(1行)\r
+*              char *Tmp : 一時ワーク\r
+*              int Add1 : 加算パラメータ1\r
+*              int Add2 : 加算パラメータ2\r
+*              int Day : 日 (0=ここで取得する)\r
 *\r
 *      Return Value\r
-*              int \83\8a\83X\83g\83^\83C\83v (LIST_xxx)\r
+*              int リストタイプ (LIST_xxx)\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int CheckUnixType(char *Str, char *Tmp, int Add1, int Add2, int Day)\r
@@ -3626,37 +3825,37 @@ static int CheckUnixType(char *Str, char *Tmp, int Add1, int Add2, int Day)
        Flag = 0;\r
        Ret = LIST_UNKNOWN;\r
 \r
-//Day\82É\82æ\82Á\82ÄAdd3\82ð\95Ï\82¦\82é\r
+//DayによってAdd3を変える\r
 \r
        Add3 = 0;\r
        if(Day != 0)\r
                Add3 = -1;\r
 \r
-       // unix\8cn\83`\83F\83b\83N\r
+       // unix系チェック\r
        if((Day != 0) ||\r
-          ((FindField(Str, Tmp, 6+Add1+Add2+Add3, NO) == SUCCESS) &&\r
+          ((FindField(Str, Tmp, 6+Add1+Add2+Add3, NO) == FFFTP_SUCCESS) &&\r
                ((atoi(Tmp) >= 1) && (atoi(Tmp) <= 31))))\r
        {\r
-               if((FindField(Str, Tmp, 7+Add1+Add2+Add3, NO) == SUCCESS) &&\r
-                  ((atoi(Tmp) >= 1900) || (GetHourAndMinute(Tmp, &Hour, &Minute) == SUCCESS)))\r
+               if((FindField(Str, Tmp, 7+Add1+Add2+Add3, NO) == FFFTP_SUCCESS) &&\r
+                  ((atoi(Tmp) >= 1900) || (GetHourAndMinute(Tmp, &Hour, &Minute) == FFFTP_SUCCESS)))\r
                {\r
-                       if(FindField(Str, Tmp, 8+Add1+Add2+Add3, NO) == SUCCESS)\r
+                       if(FindField(Str, Tmp, 8+Add1+Add2+Add3, NO) == FFFTP_SUCCESS)\r
                        {\r
                                Flag = 1;\r
                        }\r
                }\r
        }\r
 \r
-       // \92\86\8d\91\8cêSolaris\90ê\97p\r
+       // 中国語Solaris専用\r
        if(Flag == 0)\r
        {\r
-          if((FindField(Str, Tmp, 7+Add1+Add2+Add3, NO) == SUCCESS) &&\r
+          if((FindField(Str, Tmp, 7+Add1+Add2+Add3, NO) == FFFTP_SUCCESS) &&\r
                  ((atoi(Tmp) >= 1) && (atoi(Tmp) <= 31)))\r
                {\r
-                       if((FindField(Str, Tmp, 5+Add1+Add2+Add3, NO) == SUCCESS) &&\r
+                       if((FindField(Str, Tmp, 5+Add1+Add2+Add3, NO) == FFFTP_SUCCESS) &&\r
                           (atoi(Tmp) >= 1900))\r
                        {\r
-                               if((FindField(Str, Tmp, 6+Add1+Add2+Add3, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Tmp, 6+Add1+Add2+Add3, NO) == FFFTP_SUCCESS) &&\r
                                   (((atoi(Tmp) >= 1) && (atoi(Tmp) <= 9) && \r
                                         ((unsigned char)Tmp[1] == 0xD4) &&\r
                                         ((unsigned char)Tmp[2] == 0xC2)) ||\r
@@ -3664,7 +3863,7 @@ static int CheckUnixType(char *Str, char *Tmp, int Add1, int Add2, int Day)
                                         ((unsigned char)Tmp[2] == 0xD4) && \r
                                         ((unsigned char)Tmp[3] == 0xC2))))\r
                                {\r
-                                       if(FindField(Str, Tmp, 8+Add1+Add2+Add3, NO) == SUCCESS)\r
+                                       if(FindField(Str, Tmp, 8+Add1+Add2+Add3, NO) == FFFTP_SUCCESS)\r
                                        {\r
                                                Flag = 2;\r
                                        }\r
@@ -3756,18 +3955,18 @@ static int CheckUnixType(char *Str, char *Tmp, int Add1, int Add2, int Day)
 }\r
 \r
 \r
-/*----- HH:MM \8c`\8e®\82Ì\95\8e\9a\97ñ\82©\82Ç\82¤\82©\82ð\83`\83F\83b\83N ----------------------------------\r
+/*----- HH:MM 形式の文字列かどうかをチェック ----------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
+*              char *Str : 文字列\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X (YES/NO)\r
+*              int ステータス (YES/NO)\r
 *\r
 *      Note\r
-*              \8bæ\90Ø\82è\95\8e\9a\82Í\89½\82Å\82à\82æ\82¢\r
-*              \8e\9e\95ª\82Å\82È\82­\82Ä\82à\82æ\82¢\r
-*              \8cã\82ë\82É\97]\95ª\82È\95\8e\9a\82ª\95t\82¢\82Ä\82¢\82Ä\82à\82æ\82¢\r
+*              区切り文字は何でもよい\r
+*              時分でなくてもよい\r
+*              後ろに余分な文字が付いていてもよい\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int CheckHHMMformat(char *Str)\r
@@ -3788,22 +3987,22 @@ static int CheckHHMMformat(char *Str)
 }\r
 \r
 \r
-/*----- YY/MM/DD \8c`\8e®\82Ì\95\8e\9a\97ñ\82©\82Ç\82¤\82©\82ð\83`\83F\83b\83N -------------------------------\r
+/*----- YY/MM/DD 形式の文字列かどうかをチェック -------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
-*              char Sym : \90\94\8e\9a\82Ì\91ã\82í\82è\82É\8eg\82¦\82é\8bL\8d\86 (NUL=\90\94\8e\9a\88È\8aO\8eg\82¦\82È\82¢)\r
-*              int Dig3 : 3\8c\85\82Ì\94N\82ð\8b\96\89Â\r
+*              char *Str : 文字列\r
+*              char Sym : 数字の代わりに使える記号 (NUL=数字以外使えない)\r
+*              int Dig3 : 3桁の年を許可\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      0 = \8aY\93\96\82µ\82È\82¢\r
+*              int ステータス\r
+*                      0 = 該当しない\r
 *                      1 = ??/??/??, ??/??/???\r
 *                      2 = ???/??/??\r
 *\r
 *      Note\r
-*              \8bæ\90Ø\82è\95\8e\9a\82Í\89½\82Å\82à\82æ\82¢\r
-*              \94N\8c\8e\93ú\82Å\82È\82­\82Ä\82à\82æ\82¢\r
+*              区切り文字は何でもよい\r
+*              年月日でなくてもよい\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int CheckYYMMDDformat(char *Str, char Sym, int Dig3)\r
@@ -3845,18 +4044,18 @@ static int CheckYYMMDDformat(char *Str, char Sym, int Dig3)
 }\r
 \r
 \r
-/*----- YYYY/MM/DD \8c`\8e®\82Ì\95\8e\9a\97ñ\82©\82Ç\82¤\82©\82ð\83`\83F\83b\83N -----------------------------\r
+/*----- YYYY/MM/DD 形式の文字列かどうかをチェック -----------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
-*              char Sym : \90\94\8e\9a\82Ì\91ã\82í\82è\82É\8eg\82¦\82é\8bL\8d\86 (NUL=\90\94\8e\9a\88È\8aO\8eg\82¦\82È\82¢)\r
+*              char *Str : 文字列\r
+*              char Sym : 数字の代わりに使える記号 (NUL=数字以外使えない)\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X (YES/NO)\r
+*              int ステータス (YES/NO)\r
 *\r
 *      Note\r
-*              \8bæ\90Ø\82è\95\8e\9a\82Í\89½\82Å\82à\82æ\82¢\r
-*              \94N\8c\8e\93ú\82Å\82È\82­\82Ä\82à\82æ\82¢\r
+*              区切り文字は何でもよい\r
+*              年月日でなくてもよい\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int CheckYYYYMMDDformat(char *Str, char Sym)\r
@@ -3878,21 +4077,21 @@ static int CheckYYYYMMDDformat(char *Str, char Sym)
 }\r
 \r
 \r
-/*----- \83t\83@\83C\83\8b\8fî\95ñ\82©\82ç\83t\83@\83C\83\8b\96¼\81A\83T\83C\83Y\82È\82Ç\82ð\8eæ\82è\8fo\82· ----------------------\r
+/*----- ファイル情報からファイル名、サイズなどを取り出す ----------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \83t\83@\83C\83\8b\8fî\95ñ\81i\82P\8ds\81j\r
-*              int ListType : \83\8a\83X\83g\82Ì\83^\83C\83v\r
-*              char *Name : \83t\83@\83C\83\8b\96¼\82Ì\83R\83s\81[\90æ\r
-*              LONGLONG *Size : \83T\83C\83Y\82Ì\83R\83s\81[\90æ\r
-*              FILETIME *Time : \93ú\95t\82Ì\83R\83s\81[\90æ\r
-*              int *Attr : \91®\90«\82Ì\83R\83s\81[\90æ\r
-*              char *Owner : \83I\81[\83i\96¼\r
-*              int *Link : \83\8a\83\93\83N\82©\82Ç\82¤\82© (YES/NO)\r
-*              int *InfoExist : \8e\9e\8d\8f\82Ì\8fî\95ñ\82ª\82 \82Á\82½\82©\82Ç\82¤\82© (YES/NO)\r
+*              char *Str : ファイル情報(1行)\r
+*              int ListType : リストのタイプ\r
+*              char *Name : ファイル名のコピー先\r
+*              LONGLONG *Size : サイズのコピー先\r
+*              FILETIME *Time : 日付のコピー先\r
+*              int *Attr : 属性のコピー先\r
+*              char *Owner : オーナ名\r
+*              int *Link : リンクかどうか (YES/NO)\r
+*              int *InfoExist : 時刻の情報があったかどうか (YES/NO)\r
 *\r
 *      Return Value\r
-*              int \8eí\97Þ (NODE_xxxx)\r
+*              int 種類 (NODE_xxxx)\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size, FILETIME *Time, int *Attr, char *Owner, int *Link, int *InfoExist)\r
@@ -3914,8 +4113,10 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
        static const int DosDate[3][3][2] = { { {0, 0}, {3, 4}, {6, 7} }, { {6, 7}, {0, 0}, {3, 4} }, { {6, 7}, {0, 0}, {3, 4} } };\r
        static const int DosLongFname[3] = { YES, YES, NO };\r
 \r
-       /* \82Ü\82¸\83N\83\8a\83A\82µ\82Ä\82¨\82­ */\r
+       /* まずクリアしておく */\r
        Ret = NODE_NONE;\r
+       // バグ対策\r
+       memset(Fname, NUL, FMAX_PATH+1);\r
        *Size = -1;\r
        *Attr = 0;\r
        *Link = NO;\r
@@ -3943,7 +4144,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                        *InfoExist |= (FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, DosPos[offs][0], NO);\r
                        if((Pos = strchr(Buf, ':')) != NULL)\r
                        {\r
@@ -3968,7 +4169,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                }\r
                        }\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, DosPos[offs][1], NO);\r
                        if((offs2 = CheckYYMMDDformat(Buf, NUL, YES)) == 0)\r
                                break;\r
@@ -3979,12 +4180,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, DosPos[offs][2], NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, DosPos[offs][3], DosLongFname[offs]) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, DosPos[offs][3], DosLongFname[offs]) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(Buf[0] == '<')\r
@@ -3995,13 +4196,13 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_DOS_4 :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 0, NO);\r
                        sTime.wYear = atoi(Buf);\r
                        sTime.wMonth = atoi(Buf+5);\r
                        sTime.wDay = atoi(Buf+8);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        *InfoExist |= FINFO_TIME;\r
                        FindField(Str, Buf, 1, NO);\r
                        sTime.wHour = atoi(Buf);\r
@@ -4011,12 +4212,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 2, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 3, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 3, YES) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(Buf[0] == '<')\r
@@ -4027,7 +4228,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_OS2 :\r
                        *InfoExist |= (FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 3, NO);\r
                        if((Pos = strchr(Buf, ':')) != NULL)\r
                        {\r
@@ -4038,7 +4239,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                sTime.wMilliseconds = 0;\r
                        }\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 2, NO);\r
                        sTime.wYear = Assume1900or2000(atoi(Buf+6));\r
                        sTime.wMonth = atoi(Buf+0);\r
@@ -4046,12 +4247,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 4, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 4, YES) == FFFTP_SUCCESS)\r
                        {\r
                                FindField(Str, Buf, 1, NO);\r
                                Ret = NODE_FILE;\r
@@ -4063,20 +4264,20 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_CHAMELEON :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE | FINFO_ATTR);\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 6, NO);\r
                        strcat(Buf, "------");\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 2, NO);\r
-                       GetMonth(Buf, &sTime.wMonth, &sTime.wDay);      /* wDay\82Í\8fí\82É0 */\r
+                       GetMonth(Buf, &sTime.wMonth, &sTime.wDay);      /* wDayは常に0 */\r
                        FindField(Str, Buf, 3, NO);\r
                        sTime.wDay = atoi(Buf);\r
                        FindField(Str, Buf, 4, NO);\r
                        sTime.wYear = atoi(Buf);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 5, NO);\r
                        sTime.wHour = atoi(Buf);\r
                        sTime.wMinute = atoi(Buf+3);\r
@@ -4085,12 +4286,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 1, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 0, NO) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 0, NO) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(Buf[0] == '<')\r
@@ -4101,18 +4302,18 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_AS400 :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 0, NO);\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 3, NO);\r
                        sTime.wHour = atoi(Buf);\r
                        sTime.wMinute = atoi(Buf+3);\r
                        sTime.wSecond = 0;\r
                        sTime.wMilliseconds = 0;\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 2, NO);\r
                        sTime.wYear = Assume1900or2000(atoi(Buf));\r
                        sTime.wMonth = atoi(Buf + 3);\r
@@ -4120,12 +4321,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 1, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 5, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 5, YES) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if((Pos = strchr(Fname, '/')) != NULL)\r
@@ -4139,12 +4340,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_M1800 :\r
                        *InfoExist |= FINFO_ATTR;\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 0, NO);\r
                        strcat(Buf, "------");\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        Time->dwLowDateTime = 0;\r
                        Time->dwHighDateTime = 0;\r
                        FindField(Str, Buf, 5, NO);\r
@@ -4163,8 +4364,8 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
                        }\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 6, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 6, YES) == FFFTP_SUCCESS)\r
                        {\r
                                RemoveTailingSpaces(Fname);\r
                                Ret = NODE_FILE;\r
@@ -4179,18 +4380,18 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_GP6000 :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE | FINFO_ATTR);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 3, NO);\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 2, NO);\r
                        sTime.wHour = atoi(Buf);\r
                        sTime.wMinute = atoi(Buf+3);\r
                        sTime.wSecond = 0;\r
                        sTime.wMilliseconds = 0;\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 1, NO);\r
                        sTime.wYear = Assume1900or2000(atoi(Buf));\r
                        sTime.wMonth = atoi(Buf + 3);\r
@@ -4198,16 +4399,16 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 5, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 6, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 6, YES) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(strchr("dl", Buf[0]) != NULL)\r
@@ -4217,7 +4418,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                case LIST_ACOS :\r
                case LIST_ACOS_4 :\r
-                       /* \96¼\91O */\r
+                       /* 名前 */\r
                        FindField(Str, Fname, 0, NO);\r
                        Ret = NODE_FILE;\r
                        break;\r
@@ -4225,11 +4426,11 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_VMS :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 1, NO);\r
                        *Size = _atoi64(Buf) * BLOCK_SIZE;\r
 \r
-                       /* \8e\9e\8d\8f\81^\93ú\95t */\r
+                       /* 時刻/日付 */\r
                        FindField(Str, Buf, 2, NO);\r
                        GetVMSdate(Buf, &sTime.wYear, &sTime.wMonth, &sTime.wDay);\r
 \r
@@ -4241,7 +4442,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \96¼\91O */\r
+                       /* 名前 */\r
                        FindField(Str, Fname, 0, NO);\r
 \r
                        Ret = NODE_FILE;\r
@@ -4249,8 +4450,8 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        {\r
                                if(_strnicmp(Pos, ".DIR;", 5) == 0)\r
                                {\r
-                                       /* OpenVMS\82Ì\8fê\8d\87\81A\83t\83@\83C\83\8b/\83f\83B\83\8c\83N\83g\83\8a\8dí\8f\9c\8e\9e\82É\82Í".DIR;?"\82Ü\82Å\82È\82¢\82Æ\r
-                                        * \8dí\8f\9c\82Å\82«\82È\82¢\82Ì\82Å\81A\82±\82±\82Å\82Í\82Â\82Ô\82³\82È\82¢ */\r
+                                       /* OpenVMSの場合、ファイル/ディレクトリ削除時には".DIR;?"までないと\r
+                                        * 削除できないので、ここではつぶさない */\r
 #if !defined(HAVE_OPENVMS)\r
                                        *Pos = NUL;\r
 #endif\r
@@ -4263,21 +4464,21 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        *InfoExist |= FINFO_SIZE;\r
                        offs = 2;\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 2, NO);\r
                        *Size = _atoi64(Buf);\r
-                       /* \82±\82±\82Ébreak\82Í\82È\82¢ */\r
+                       /* ここにbreakはない */\r
 \r
                case LIST_OS7_1 :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_ATTR);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 1+offs, NO);\r
                        sTime.wYear = Assume1900or2000(atoi(Buf));\r
                        sTime.wMonth = atoi(Buf + 3);\r
                        sTime.wDay = atoi(Buf + 6);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 2+offs, NO);\r
                        sTime.wHour = atoi(Buf);\r
                        sTime.wMinute = atoi(Buf+3);\r
@@ -4286,12 +4487,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 3+offs, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 3+offs, YES) == FFFTP_SUCCESS)\r
                        {\r
                                RemoveTailingSpaces(Fname);\r
                                Ret = NODE_FILE;\r
@@ -4301,7 +4502,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        break;\r
 \r
                case LIST_STRATUS :\r
-                       if(FindField(Str, Buf, 0, NO) != SUCCESS)\r
+                       if(FindField(Str, Buf, 0, NO) != FFFTP_SUCCESS)\r
                                break;\r
                        if(_strnicmp(Buf, "Files:", 6) == 0)\r
                                StratusMode = 0;\r
@@ -4320,15 +4521,15 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                                *InfoExist |= (FINFO_TIME | FINFO_DATE);\r
 \r
-                               /* \93ú\95t */\r
-                               if(FindField(Str, Buf, 2+offs, NO) != SUCCESS)\r
+                               /* 日付 */\r
+                               if(FindField(Str, Buf, 2+offs, NO) != FFFTP_SUCCESS)\r
                                        break;\r
                                sTime.wYear = Assume1900or2000(atoi(Buf));\r
                                sTime.wMonth = atoi(Buf + 3);\r
                                sTime.wDay = atoi(Buf + 6);\r
 \r
-                               /* \8e\9e\8d\8f */\r
-                               if(FindField(Str, Buf, 3+offs, NO) != SUCCESS)\r
+                               /* 時刻 */\r
+                               if(FindField(Str, Buf, 3+offs, NO) != FFFTP_SUCCESS)\r
                                        break;\r
                                sTime.wHour = atoi(Buf);\r
                                sTime.wMinute = atoi(Buf+3);\r
@@ -4337,21 +4538,21 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                SystemTimeToFileTime(&sTime, Time);\r
                                SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                               /* \96¼\91O */\r
-                               if(FindField(Str, Fname, 4+offs, YES) != SUCCESS)\r
+                               /* 名前 */\r
+                               if(FindField(Str, Fname, 4+offs, YES) != FFFTP_SUCCESS)\r
                                        break;\r
 \r
                                if(StratusMode == 0)\r
                                {\r
                                        *InfoExist |= FINFO_SIZE;\r
 \r
-                                       /* \83T\83C\83Y */\r
-                                       if(FindField(Str, Buf, 1, NO) != SUCCESS)\r
+                                       /* サイズ */\r
+                                       if(FindField(Str, Buf, 1, NO) != FFFTP_SUCCESS)\r
                                                break;\r
                                        *Size = _atoi64(Buf) * 4096;\r
 \r
-                                       /* \8eí\97Þ\81i\83I\81[\83i\96¼\82Ì\83t\83B\81[\83\8b\83h\82É\82¢\82ê\82é\81j */\r
-                                       if(FindField(Str, Buf, 2, NO) != SUCCESS)\r
+                                       /* 種類(オーナ名のフィールドにいれる) */\r
+                                       if(FindField(Str, Buf, 2, NO) != FFFTP_SUCCESS)\r
                                                break;\r
                                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
@@ -4365,21 +4566,21 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_IRMX :\r
                        *InfoExist |= (FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        for(offs = 11; offs > 7; offs--)\r
                        {\r
-                               if((err = FindField(Str, Buf, offs, NO)) == SUCCESS)\r
+                               if((err = FindField(Str, Buf, offs, NO)) == FFFTP_SUCCESS)\r
                                        break;\r
                        }\r
-                       if(err != SUCCESS)\r
+                       if(err != FFFTP_SUCCESS)\r
                                break;\r
                        if(IsDigit(*Buf) == 0)\r
                                break;\r
                        sTime.wYear = Assume1900or2000(atoi(Buf));\r
-                       if(FindField(Str, Buf, --offs, NO) != SUCCESS)\r
+                       if(FindField(Str, Buf, --offs, NO) != FFFTP_SUCCESS)\r
                                break;\r
                        GetMonth(Buf, &sTime.wMonth, &sTime.wDay);\r
-                       if(FindField(Str, Buf, --offs, NO) != SUCCESS)\r
+                       if(FindField(Str, Buf, --offs, NO) != FFFTP_SUCCESS)\r
                                break;\r
                        if(IsDigit(*Buf) == 0)\r
                                break;\r
@@ -4391,36 +4592,36 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
-                       if(FindField(Str, Buf, --offs, NO) != SUCCESS)\r
+                       /* オーナ名 */\r
+                       if(FindField(Str, Buf, --offs, NO) != FFFTP_SUCCESS)\r
                                break;\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        do\r
                        {\r
-                               if((err = FindField(Str, Buf, --offs, NO)) != SUCCESS)\r
+                               if((err = FindField(Str, Buf, --offs, NO)) != FFFTP_SUCCESS)\r
                                        break;\r
                        }\r
                        while(IsDigit(*Buf) == 0);\r
                        --offs;\r
-                       if((err = FindField(Str, Buf, --offs, NO)) != SUCCESS)\r
+                       if((err = FindField(Str, Buf, --offs, NO)) != FFFTP_SUCCESS)\r
                                break;\r
                        RemoveComma(Buf);\r
                        *Size = _atoi64(Buf);\r
-                       if((err = FindField(Str, Buf, --offs, NO)) != SUCCESS)\r
+                       if((err = FindField(Str, Buf, --offs, NO)) != FFFTP_SUCCESS)\r
                                break;\r
                        if(IsDigit(*Buf) == 0)\r
                                break;\r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 0, NO) != SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 0, NO) != FFFTP_SUCCESS)\r
                                break;\r
-                       /* \8eí\97Þ */\r
+                       /* 種類 */\r
                        if(offs == 0)\r
                                Ret = NODE_FILE;\r
                        else\r
                        {\r
-                               if((FindField(Str, Buf, 1, NO) == SUCCESS) &&\r
+                               if((FindField(Str, Buf, 1, NO) == FFFTP_SUCCESS) &&\r
                                   (strcmp(Buf, "DR") == 0))\r
                                        Ret = NODE_DIR;\r
                                else\r
@@ -4431,15 +4632,15 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_ALLIED :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 3, NO);\r
-                       GetMonth(Buf, &sTime.wMonth, &sTime.wDay);      /* wDay\82Í\8fí\82É0 */\r
+                       GetMonth(Buf, &sTime.wMonth, &sTime.wDay);      /* wDayは常に0 */\r
                        FindField(Str, Buf, 4, NO);\r
                        sTime.wDay = atoi(Buf);\r
                        FindField(Str, Buf, 6, NO);\r
                        sTime.wYear = atoi(Buf);\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 5, NO);\r
                        sTime.wHour = atoi(Buf);\r
                        sTime.wMinute = atoi(Buf+3);\r
@@ -4448,12 +4649,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 1, NO) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 1, NO) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(Buf[0] == '<')\r
@@ -4464,7 +4665,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_OS9 :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 1, NO);\r
                        sTime.wYear = Assume1900or2000(atoi(Buf));\r
                        sTime.wMonth = atoi(Buf + 3);\r
@@ -4472,7 +4673,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \8e\9e\8d\8f */\r
+                       /* 時刻 */\r
                        FindField(Str, Buf, 2, NO);\r
                        sTime.wHour = atoi_n(Buf, 2);\r
                        sTime.wMinute = atoi(Buf+2);\r
@@ -4481,19 +4682,19 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 5, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 0, NO);\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 3, NO);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 6, NO) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 6, NO) == FFFTP_SUCCESS)\r
                        {\r
                                if((Buf[0] == 'd') || (Buf[0] == 'D'))\r
                                        Ret = NODE_DIR;\r
@@ -4506,7 +4707,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        *InfoExist |= FINFO_DATE;\r
 \r
 \r
-                       /* \93ú\95t */\r
+                       /* 日付 */\r
                        FindField(Str, Buf, 2, NO);\r
                        sTime.wYear = atoi(Buf);\r
                        sTime.wMonth = atoi(Buf + 5);\r
@@ -4518,9 +4719,9 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \96¼\91O */\r
+                       /* 名前 */\r
                        FindField(Str, Buf, 8, NO);\r
-                       if(FindField(Str, Fname, 9, NO) == SUCCESS)\r
+                       if(FindField(Str, Fname, 9, NO) == FFFTP_SUCCESS)\r
                        {\r
                                if(strcmp(Buf, "PO") == 0)\r
                                        Ret = NODE_DIR;\r
@@ -4532,20 +4733,20 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_AGILENT :\r
                        *InfoExist |= (FINFO_SIZE | FINFO_ATTR);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 2, NO);\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 4, NO);\r
                        *Size = _atoi64(Buf);\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 5, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 5, YES) == FFFTP_SUCCESS)\r
                        {\r
                                Ret = NODE_FILE;\r
                                if(strchr("dl", Buf[0]) != NULL)\r
@@ -4556,20 +4757,20 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_SHIBASOKU :\r
                        *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 0, NO);\r
                        if(IsDigit(Buf[0]))\r
                        {\r
                                *Size = _atoi64(Buf);\r
 \r
-                               /* \93ú\95t */\r
+                               /* 日付 */\r
                                FindField(Str, Buf, 1, NO);\r
                                Buf[3] = '\0';\r
                                GetMonth(Buf, &sTime.wMonth, &sTime.wDay);\r
                                sTime.wDay = atoi(Buf+4);\r
                                sTime.wYear = atoi(Buf+7);\r
 \r
-                               /* \8e\9e\8d\8f */\r
+                               /* 時刻 */\r
                                FindField(Str, Buf, 2, NO);\r
                                sTime.wHour = atoi(Buf);\r
                                sTime.wMinute = atoi(Buf+3);\r
@@ -4578,12 +4779,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                SystemTimeToFileTime(&sTime, Time);\r
                                SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                               /* \96¼\91O */\r
+                               /* 名前 */\r
                                FindField(Str, Fname, 3, NO);\r
 \r
-                               /* \8eí\97Þ */\r
+                               /* 種類 */\r
                                Ret = NODE_FILE;\r
-                               if(FindField(Str, Buf, 4, NO) == SUCCESS)\r
+                               if(FindField(Str, Buf, 4, NO) == FFFTP_SUCCESS)\r
                                {\r
                                        if(strcmp(Buf, "<DIR>") == 0)\r
                                                Ret = NODE_DIR;\r
@@ -4591,6 +4792,142 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        }\r
                        break;\r
 \r
+#if defined(HAVE_TANDEM)\r
+               case LIST_TANDEM :\r
+                       *InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE | FINFO_ATTR);\r
+                       /* Open 中だったらずらす */\r
+                       if(FindField(Str, Buf, 1, NO) != FFFTP_SUCCESS)\r
+                               break;\r
+                       if (!strncmp(Buf, "O", 1)) {\r
+                               offs = 1;\r
+                       }\r
+                       /* 日付 */\r
+                       if(FindField(Str, Buf, 3 + offs, NO) != FFFTP_SUCCESS)\r
+                               break;\r
+                       if (Buf[1] == '-') {  /* 日付が 1桁 */\r
+                               sTime.wYear = Assume1900or2000(atoi(Buf + 6));\r
+                               Buf[5] = 0;\r
+                               GetMonth(Buf+2, &sTime.wMonth, &sTime.wDay);    /* wDayは常に0 */\r
+                               sTime.wDay = atoi(Buf);\r
+                               sTime.wDayOfWeek = 0;\r
+                       } else {\r
+                               sTime.wYear = Assume1900or2000(atoi(Buf + 7));\r
+                               Buf[6] = 0;\r
+                               GetMonth(Buf+3, &sTime.wMonth, &sTime.wDay);    /* wDayは常に0 */\r
+                               sTime.wDay = atoi(Buf);\r
+                               sTime.wDayOfWeek = 0;\r
+                       }\r
+                       /* 時刻 */\r
+                       FindField(Str, Buf, 4 + offs, NO);\r
+                       sTime.wHour = atoi(Buf);\r
+                       sTime.wMinute = atoi(Buf+3);\r
+                       sTime.wSecond = atoi(Buf+6);\r
+                       sTime.wMilliseconds = 0;\r
+                       SystemTimeToFileTime(&sTime, Time);\r
+                       SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
+\r
+                       /* 属性 セキュリティではなく FileCode を保存する */\r
+                       FindField(Str, Buf, 1 + offs, NO);\r
+                       *Attr = atoi(Buf);\r
+                       /* サイズ */\r
+                       FindField(Str, Buf, 2 + offs, NO);\r
+                       *Size = _atoi64(Buf);\r
+                       /* オーナ名 */\r
+                       if(FindField(Str, Buf, 5 + offs, NO) == FFFTP_SUCCESS) {\r
+                               if(strncmp(Buf, "Owner", sizeof("Owner"))) {\r
+                                       memset(Owner, NUL, OWNER_NAME_LEN+1);\r
+                                       strncpy(Owner, Buf, OWNER_NAME_LEN);\r
+                                       /* 通常は 255,255 だが、20, 33 などにも対応する */\r
+                                       /* 最後の文字が , だったら後ろとつなげる */\r
+                                       if (Buf[strlen(Buf)-1] == ',') {\r
+                                               FindField(Str, Buf, 6 + offs, NO);\r
+                                               strncat(Owner, Buf, OWNER_NAME_LEN - strlen(Buf));\r
+                                       }\r
+                                       /* ファイル名 */\r
+                                       if(FindField(Str, Fname, 0, NO) == FFFTP_SUCCESS) {\r
+                                               Ret = NODE_FILE;\r
+                                       }\r
+                               }\r
+                       }\r
+                       break;\r
+#endif\r
+\r
+                       // MLSD対応\r
+                       // 以下の形式に対応\r
+                       // fact1=value1;fact2=value2;fact3=value3; filename\r\n\r
+                       // 不完全な実装のホストが存在するため以下の形式も許容\r
+                       // fact1=value1;fact2=value2;fact3=value3 filename\r\n\r
+                       // fact1=value1;fact2=value2;fact3=value3;filename\r\n\r
+               case LIST_MLSD:\r
+                       {\r
+                               int i = 0;\r
+                               char StrBuf[(FMAX_PATH * 2) + 1];\r
+                               char Fact[FMAX_PATH + 1];\r
+                               char Name[FMAX_PATH + 1];\r
+                               char Value[FMAX_PATH + 1];\r
+                               char* pFileName;\r
+                               strncpy(StrBuf, Str, FMAX_PATH * 2);\r
+                               StrBuf[FMAX_PATH * 2] = '\0';\r
+                               if((pFileName = strstr(StrBuf, "; ")) != NULL)\r
+                               {\r
+                                       *pFileName = '\0';\r
+                                       pFileName += 2;\r
+                               }\r
+                               else if((pFileName = strchr(StrBuf, ' ')) != NULL)\r
+                               {\r
+                                       *pFileName = '\0';\r
+                                       pFileName++;\r
+                               }\r
+                               else if((pFileName = strrchr(StrBuf, ';')) != NULL)\r
+                               {\r
+                                       *pFileName = '\0';\r
+                                       pFileName++;\r
+                               }\r
+                               if(pFileName != NULL)\r
+                                       strcpy(Fname, pFileName);\r
+                               while(FindField2(StrBuf, Fact, ';', i, NO) == FFFTP_SUCCESS)\r
+                               {\r
+                                       if(FindField2(Fact, Name, '=', 0, NO) == FFFTP_SUCCESS && FindField2(Fact, Value, '=', 1, NO) == FFFTP_SUCCESS)\r
+                                       {\r
+                                               if(_stricmp(Name, "type") == 0)\r
+                                               {\r
+                                                       if(_stricmp(Value, "dir") == 0)\r
+                                                               Ret = NODE_DIR;\r
+                                                       else if(_stricmp(Value, "file") == 0)\r
+                                                               Ret = NODE_FILE;\r
+                                               }\r
+                                               else if(_stricmp(Name, "size") == 0)\r
+                                               {\r
+                                                       *Size = _atoi64(Value);\r
+                                                       *InfoExist |= FINFO_SIZE;\r
+                                               }\r
+                                               else if(_stricmp(Name, "modify") == 0)\r
+                                               {\r
+                                                       sTime.wYear = atoi_n(Value, 4);\r
+                                                       sTime.wMonth = atoi_n(Value + 4, 2);\r
+                                                       sTime.wDay = atoi_n(Value + 6, 2);\r
+                                                       sTime.wHour = atoi_n(Value + 8, 2);\r
+                                                       sTime.wMinute = atoi_n(Value + 10, 2);\r
+                                                       sTime.wSecond = atoi_n(Value + 12, 2);\r
+                                                       sTime.wMilliseconds = 0;\r
+                                                       SystemTimeToFileTime(&sTime, Time);\r
+                                                       // 時刻はGMT\r
+//                                                     SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
+                                                       *InfoExist |= FINFO_DATE | FINFO_TIME;\r
+                                               }\r
+                                               else if(_stricmp(Name, "UNIX.mode") == 0)\r
+                                               {\r
+                                                       *Attr = strtol(Value, NULL, 16);\r
+                                                       *InfoExist |= FINFO_ATTR;\r
+                                               }\r
+                                               else if(_stricmp(Name, "UNIX.owner") == 0)\r
+                                                       strcpy(Owner, Value);\r
+                                       }\r
+                                       i++;\r
+                               }\r
+                       }\r
+                       break;\r
+\r
                case LIST_UNIX_10 :\r
                case LIST_UNIX_11 :\r
                case LIST_UNIX_12 :\r
@@ -4618,10 +4955,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_UNIX_73 :\r
                case LIST_UNIX_74 :\r
                case LIST_UNIX_75 :\r
-// MELCOM\82Í\83r\83b\83g\83t\83\89\83O\82É\82È\82Á\82Ä\82¢\82é\r
+// MELCOMはビットフラグになっている\r
 //             case LIST_MELCOM :\r
+               // linux-ftpd\r
+               case LIST_UNIX_16 :\r
                default:\r
-                       /* offs\82Í\83T\83C\83Y\82Ì\88Ê\92u, offs=0\82Í\83J\83\89\83\804 */\r
+                       /* offsはサイズの位置, offs=0はカラム4 */\r
                        offs = 0;\r
                        if((ListType == LIST_UNIX_12) ||\r
                           (ListType == LIST_UNIX_13) ||\r
@@ -4652,8 +4991,18 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                           (ListType == LIST_UNIX_74))\r
                                offs = 1;\r
 \r
-                       /* offs2\82Í\8e\9e\8aÔ(\82à\82µ\82­\82Í\94N)\82Ì\88Ê\92u */\r
+                       /* offs2は時間(もしくは年)の位置 */\r
                        offs2 = 0;\r
+                       // linux-ftpd\r
+//                     if((ListType == LIST_UNIX_11) ||\r
+//                        (ListType == LIST_UNIX_13) ||\r
+//                        (ListType == LIST_UNIX_21) ||\r
+//                        (ListType == LIST_UNIX_23) ||\r
+//                        (ListType == LIST_UNIX_51) ||\r
+//                        (ListType == LIST_UNIX_61) ||\r
+//                        (ListType == LIST_UNIX_63) ||\r
+//                        (ListType == LIST_UNIX_71) ||\r
+//                        (ListType == LIST_UNIX_73))\r
                        if((ListType == LIST_UNIX_11) ||\r
                           (ListType == LIST_UNIX_13) ||\r
                           (ListType == LIST_UNIX_21) ||\r
@@ -4662,10 +5011,11 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                           (ListType == LIST_UNIX_61) ||\r
                           (ListType == LIST_UNIX_63) ||\r
                           (ListType == LIST_UNIX_71) ||\r
-                          (ListType == LIST_UNIX_73))\r
+                          (ListType == LIST_UNIX_73) ||\r
+                          (ListType == LIST_UNIX_16))\r
                                offs2 = -1;\r
 \r
-                       /* offs3\82Í\83I\81[\83i\96¼\82Ì\88Ê\92u */\r
+                       /* offs3はオーナ名の位置 */\r
                        offs3 = 0;\r
                        if((ListType == LIST_UNIX_12) ||\r
                           (ListType == LIST_UNIX_13) ||\r
@@ -4697,15 +5047,15 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                        *InfoExist |= (FINFO_DATE | FINFO_SIZE | FINFO_ATTR);\r
 \r
-                       /* \91®\90« */\r
+                       /* 属性 */\r
                        FindField(Str, Buf, 0, NO);\r
                        *Attr = AttrString2Value(Buf+1);\r
 \r
-                       /* \83I\81[\83i\96¼ */\r
+                       /* オーナ名 */\r
                        FindField(Str, Buf, 2+offs3, NO);\r
                        strncpy(Owner, Buf, OWNER_NAME_LEN);\r
 \r
-                       /* \83T\83C\83Y */\r
+                       /* サイズ */\r
                        FindField(Str, Buf, 4+offs, NO);\r
                        Pos = Buf;\r
                        if((*Pos != NUL) && (IsDigit(*Pos) == 0))\r
@@ -4724,20 +5074,30 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                        if(Flag2 == 0)\r
                        {\r
-                               /* \8e\9e\8d\8f\81^\93ú\95t */\r
+                               /* 時刻/日付 */\r
                                GetLocalTime(&sTime);\r
                                memcpy(&sTimeNow, &sTime, sizeof(SYSTEMTIME));\r
                                sTime.wSecond = 0;\r
                                sTime.wMilliseconds = 0;\r
 \r
                                FindField(Str, Buf, 5+offs, NO);\r
-                               /* \93ú\95t\82ª yy/mm/dd \82Ì\8fê\8d\87\82É\91Î\89\9e */\r
-                               if(GetYearMonthDay(Buf, &sTime.wYear, &sTime.wMonth, &sTime.wDay) == SUCCESS)\r
+                               /* 日付が yy/mm/dd の場合に対応 */\r
+                               if(GetYearMonthDay(Buf, &sTime.wYear, &sTime.wMonth, &sTime.wDay) == FFFTP_SUCCESS)\r
                                {\r
                                        sTime.wYear = Assume1900or2000(sTime.wYear);\r
 \r
                                        FindField(Str, Buf, 7+offs+offs2, NO);\r
-                                       if(GetHourAndMinute(Buf, &sTime.wHour, &sTime.wMinute) == SUCCESS)\r
+                                       if(GetHourAndMinute(Buf, &sTime.wHour, &sTime.wMinute) == FFFTP_SUCCESS)\r
+                                               *InfoExist |= FINFO_TIME;\r
+                               }\r
+                               // linux-ftpd\r
+                               else if(CheckYYYYMMDDformat(Buf, NUL) != 0)\r
+                               {\r
+                                       sTime.wYear = atoi(Buf);\r
+                                       sTime.wMonth = atoi(Buf+5);\r
+                                       sTime.wDay = atoi(Buf+8);\r
+                                       FindField(Str, Buf, 7+offs+offs2, NO);\r
+                                       if(GetHourAndMinute(Buf, &sTime.wHour, &sTime.wMinute) == FFFTP_SUCCESS)\r
                                                *InfoExist |= FINFO_TIME;\r
                                }\r
                                else\r
@@ -4750,7 +5110,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                        }\r
 \r
                                        FindField(Str, Buf, 7+offs+offs2, NO);\r
-                                       if(GetHourAndMinute(Buf, &sTime.wHour, &sTime.wMinute) == FAIL)\r
+                                       if(GetHourAndMinute(Buf, &sTime.wHour, &sTime.wMinute) == FFFTP_FAIL)\r
                                        {\r
                                                sTime.wYear = atoi(Buf);\r
                                        }\r
@@ -4758,18 +5118,20 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                        {\r
                                                *InfoExist |= FINFO_TIME;\r
 \r
-                                               /* \94N\82ª\82È\82¢ */\r
-                                               /* \8c»\8dÝ\82Ì\93ú\95t\82©\82ç\90\84\92è */\r
-                                               if((sTimeNow.wMonth == 12) && (sTime.wMonth == 1))\r
-                                                       sTime.wYear++;\r
-                                               else if(sTimeNow.wMonth+1 == sTime.wMonth)\r
+                                               /* 年がない */\r
+                                               /* 現在の日付から推定 */\r
+                                               // 恐らくホストとローカルの時刻が異なる場合の対処のようだがとりあえず無効にする\r
+//                                             if((sTimeNow.wMonth == 12) && (sTime.wMonth == 1))\r
+//                                                     sTime.wYear++;\r
+//                                             else if(sTimeNow.wMonth+1 == sTime.wMonth)\r
+                                               if(sTimeNow.wMonth+1 == sTime.wMonth)\r
                                                        /* nothing */;\r
                                                else if(sTimeNow.wMonth < sTime.wMonth)\r
                                                        sTime.wYear--;\r
 \r
 \r
 //#################\r
-                                               /* \8d¡\94N\82Ì\8d¡\93ú\88È\8d~\82Ì\83t\83@\83C\83\8b\82Í\81A\8eÀ\82Í\8b\8e\94N\82Ì\83t\83@\83C\83\8b */\r
+                                               /* 今年の今日以降のファイルは、実は去年のファイル */\r
                                                if((sTime.wYear == sTimeNow.wYear) &&\r
                                                   ((sTime.wMonth > sTimeNow.wMonth) ||\r
                                                        ((sTime.wMonth == sTimeNow.wMonth) && (sTime.wDay > sTimeNow.wDay))))\r
@@ -4781,7 +5143,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        }\r
                        else\r
                        {\r
-                               /* LIST_UNIX_?4, LIST_UNIX_?5 \82Ì\8e\9e */\r
+                               /* LIST_UNIX_?4, LIST_UNIX_?5 の時 */\r
                                FindField(Str, Buf, 5+offs, NO);\r
                                sTime.wYear = atoi(Buf);\r
                                FindField(Str, Buf, 6+offs, NO);\r
@@ -4796,8 +5158,8 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        SystemTimeToFileTime(&sTime, Time);\r
                        SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
 \r
-                       /* \96¼\91O */\r
-                       if(FindField(Str, Fname, 8+offs+offs2, YES) == SUCCESS)\r
+                       /* 名前 */\r
+                       if(FindField(Str, Fname, 8+offs+offs2, YES) == FFFTP_SUCCESS)\r
                        {\r
                                Flag = 'B';\r
                                if(OrgListType & LIST_MELCOM)\r
@@ -4814,11 +5176,12 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
                                if(strchr("dl", *Str) != NULL)\r
                                {\r
-                                       if((_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "/") == 0) ||\r
-                                          (_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "\\") == 0))\r
-                                       {\r
-                                               *(Fname + strlen(Fname) - 1) = NUL;\r
-                                       }\r
+                                       // 0x5Cが含まれる文字列を扱えないバグ修正\r
+//                                     if((_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "/") == 0) ||\r
+//                                        (_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "\\") == 0))\r
+//                                     {\r
+//                                             *(Fname + strlen(Fname) - 1) = NUL;\r
+//                                     }\r
                                        Ret = NODE_DIR;\r
                                        if(*Str == 'l')\r
                                                *Link = YES;\r
@@ -4832,28 +5195,43 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                        break;\r
        }\r
 \r
-       if((Ret != NODE_NONE) && (strlen(Fname) > 0))\r
+       // UTF-8対応\r
+//     if((Ret != NODE_NONE) && (strlen(Fname) > 0))\r
+       if(!(OrgListType & LIST_RAW_NAME) && (Ret != NODE_NONE) && (strlen(Fname) > 0))\r
        {\r
+               // UTF-8対応\r
+//             if(CheckSpecialDirName(Fname) == YES)\r
+//                     Ret = NODE_NONE;\r
+//             else\r
+//                     ChangeFnameRemote2Local(Fname, FMAX_PATH);\r
+               ChangeFnameRemote2Local(Fname, FMAX_PATH);\r
+               // UTF-8の冗長表現によるディレクトリトラバーサル対策\r
+               FixStringM(Fname, Fname);\r
+               // 0x5Cが含まれる文字列を扱えないバグ修正\r
+               if((_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "/") == 0)\r
+                       || (_mbscmp(_mbsninc(Fname, _mbslen(Fname) - 1), "\\") == 0))\r
+                       *(Fname + strlen(Fname) - 1) = NUL;\r
                if(CheckSpecialDirName(Fname) == YES)\r
                        Ret = NODE_NONE;\r
-               else\r
-                       ChangeFnameRemote2Local(Fname, FMAX_PATH);\r
+               // 文字コードが正しくないために長さが0になったファイル名は表示しない\r
+               if(strlen(Fname) == 0)\r
+                       Ret = NODE_NONE;\r
        }\r
        return(Ret);\r
 }\r
 \r
 \r
-/*----- \8ew\92è\82Ì\94Ô\8d\86\82Ì\83t\83B\81[\83\8b\83h\82ð\8b\81\82ß\82é ----------------------------------------\r
+/*----- 指定の番号のフィールドを求める ----------------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
-*              char *Buf : \95\8e\9a\97ñ\82Ì\83R\83s\81[\90æ\r
-*              int Num : \83t\83B\81[\83\8b\83h\94Ô\8d\86\r
-*              int ToLast : \95\8e\9a\97ñ\82Ì\8dÅ\8cã\82Ü\82Å\83R\83s\81[ (YES/NO)\r
+*              char *Str : 文字列\r
+*              char *Buf : 文字列のコピー先\r
+*              int Num : フィールド番号\r
+*              int ToLast : 文字列の最後までコピー (YES/NO)\r
 *\r
 *      Return Value\r
-*              int \83X\83e\81[\83^\83X\r
-*                      SUCCESS/FAIL\r
+*              int ステータス\r
+*                      FFFTP_SUCCESS/FFFTP_FAIL\r
 *----------------------------------------------------------------------------*/\r
 \r
 static int FindField(char *Str, char *Buf, int Num, int ToLast)\r
@@ -4861,7 +5239,7 @@ static int FindField(char *Str, char *Buf, int Num, int ToLast)
        char *Pos;\r
        int Sts;\r
 \r
-       Sts = FAIL;\r
+       Sts = FFFTP_FAIL;\r
        *Buf = NUL;\r
        if(Num >= 0)\r
        {\r
@@ -4896,21 +5274,68 @@ static int FindField(char *Str, char *Buf, int Num, int ToLast)
                        strncpy(Buf, Str, Pos - Str);\r
                        *(Buf + (Pos - Str)) = NUL;\r
                }\r
-               Sts = SUCCESS;\r
+               Sts = FFFTP_SUCCESS;\r
        }\r
        return(Sts);\r
 }\r
 \r
 \r
-/*----- \95\8e\9a\97ñ\82©\82ç\8c\8e\82ð\8b\81\82ß\82é --------------------------------------------------\r
+// MLSD対応\r
+static int FindField2(char *Str, char *Buf, char Separator, int Num, int ToLast)\r
+{\r
+       char *Pos;\r
+       int Sts;\r
+\r
+       Sts = FFFTP_FAIL;\r
+       *Buf = NUL;\r
+       if(Num >= 0)\r
+       {\r
+               while(*Str == Separator)\r
+                       Str++;\r
+\r
+               for(; Num > 0; Num--)\r
+               {\r
+                       if((Str = strchr(Str, Separator)) != NULL)\r
+                       {\r
+                               while(*Str == Separator)\r
+                               {\r
+                                       if(*Str == NUL)\r
+                                       {\r
+                                               Str = NULL;\r
+                                               break;\r
+                                       }\r
+                                       Str++;\r
+                               }\r
+                       }\r
+                       else\r
+                               break;\r
+               }\r
+       }\r
+\r
+       if(Str != NULL)\r
+       {\r
+               if((ToLast == YES) || ((Pos = strchr(Str, Separator)) == NULL))\r
+                       strcpy(Buf, Str);\r
+               else\r
+               {\r
+                       strncpy(Buf, Str, Pos - Str);\r
+                       *(Buf + (Pos - Str)) = NUL;\r
+               }\r
+               Sts = FFFTP_SUCCESS;\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- 文字列から月を求める --------------------------------------------------\r
 *\r
 *      Parameter\r
-*              char *Str : \95\8e\9a\97ñ\r
-*              WORD *Month : \8c\8e (0=\8c\8e\82ð\95\\82·\95\8e\9a\97ñ\82Å\82Í\82È\82¢)\r
-*              WORD *Day : \93ú (0=\93ú\82Í\8aÜ\82Ü\82ê\82Ä\82¢\82È\82¢)\r
+*              char *Str : 文字列\r
+*              WORD *Month : 月 (0=月を表す文字列ではない)\r
+*              WORD *Day : 日 (0=日は含まれていない)\r
 *\r
 *      Return Value\r
-*              \82È\82µ\r
+*              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
 static void GetMonth(char *Str, WORD *Month, WORD *Day)\r
@@ -4930,8 +5355,8 @@ static void GetMonth(char *Str, WORD *Month, WORD *Day)
        }\r
        else\r
        {\r
-               /* \81u10\8c\8e\81v\82Ì\82æ\82¤\82È\93ú\95t\82ð\95Ô\82·\82à\82Ì\82ª\82 \82é */\r
-               /* \8a¿\8e\9a\82ªJIS\82Ì\8e\9e\82Ì\82ÝSJIS\82É\95Ï\8a· */\r
+               /* 「10月」のような日付を返すものがある */\r
+               /* 漢字がJISの時のみSJISに変換 */\r
                ConvAutoToSJIS(Str, KANJI_NOCNV);\r
 \r
                Pos = Str;\r
@@ -4939,10 +5364,10 @@ static void GetMonth(char *Str, WORD *Month, WORD *Day)
                {\r
                        if(!IsDigit(*Pos))\r
                        {\r
-                               // UTF-8\91Î\89