OSDN Git Service

Modify documents.
[ffftp/ffftp.git] / filelist.c
index 9644868..74d14bb 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
 #include "OleDragDrop.h"\r
 #include "common.h"\r
 \r
+// UTF-8対応\r
+#undef __MBSWRAPPER_H__\r
+#include "mbswrapper.h"\r
+\r
 #define BUF_SIZE               256\r
 #define CF_CNT 2\r
 #define WM_DRAGDROP            (WM_APP + 100)\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
@@ -76,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
@@ -93,24 +104,30 @@ 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
 extern int ListHeight;\r
 extern char FilterStr[FILTER_EXT_LEN+1];\r
 extern HWND hHelpWin;\r
+// 外部アプリケーションへドロップ後にローカル側のファイル一覧に作業フォルダが表示されるバグ対策\r
+extern int SuppressRefresh;\r
 \r
-/* \90Ý\92è\92l */\r
+/* 設定値 */\r
 extern int LocalWidth;\r
 extern int LocalTabWidth[4];\r
 extern int RemoteTabWidth[6];\r
@@ -123,7 +140,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
@@ -132,32 +149,34 @@ static WNDPROC LocalProcPtr;
 static WNDPROC RemoteProcPtr;\r
 \r
 static HIMAGELIST ListImg = NULL;\r
+// ファイルアイコン表示対応\r
+static HIMAGELIST ListImgFileIcon = 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
@@ -166,7 +185,10 @@ 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
+       memset(&LvCol, 0, sizeof(LV_COLUMN));\r
+\r
+       /*===== ローカル側のリストビュー =====*/\r
 \r
        hWndListLocal = CreateWindowEx(/*WS_EX_STATICEDGE*/WS_EX_CLIENTEDGE,\r
                        WC_LISTVIEWA, NULL,\r
@@ -176,7 +198,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
@@ -215,7 +239,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
@@ -225,7 +249,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
@@ -275,23 +301,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
@@ -306,13 +332,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
@@ -321,13 +347,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
@@ -336,16 +362,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
@@ -354,16 +380,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
@@ -372,20 +398,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
@@ -404,18 +430,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
@@ -427,11 +453,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
@@ -443,12 +471,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
@@ -456,7 +489,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
@@ -467,10 +500,15 @@ 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
+       DisableUserOpe();\r
+       // 外部アプリケーションへドロップ後にローカル側のファイル一覧に作業フォルダが表示されるバグ対策\r
+       SuppressRefresh = 1;\r
+\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
@@ -481,7 +519,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
@@ -489,17 +527,23 @@ 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
+       // 外部アプリケーションへドロップ後にローカル側のファイル一覧に作業フォルダが表示されるバグ対策\r
+       SuppressRefresh = 0;\r
+       GetLocalDirForWnd();\r
+       // 同時接続対応\r
+       EnableUserOpe();\r
+\r
+       remoteFileListBase = FileListBase;  // あとでフリーすること\r
+       remoteFileListBaseNoExpand = FileListBaseNoExpand;  // あとでフリーすること\r
        strncpy_s(remoteFileDir, sizeof(remoteFileDir), TmpDir, _TRUNCATE);\r
 \r
 #if 0\r
@@ -531,7 +575,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
@@ -560,9 +604,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
@@ -570,7 +614,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
@@ -591,7 +635,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
@@ -601,16 +645,21 @@ 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
-                       MultiByteToWideChar(CP_ACP,0,FileName[i],-1,wbuf,BUF_SIZE);\r
-                       flen += (wcslen(wbuf) + 1) * sizeof(wchar_t);\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
-                       flen += lstrlen(FileName[i]) + 1;\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
                }\r
        }\r
 \r
@@ -620,31 +669,36 @@ 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
-                       MultiByteToWideChar(CP_ACP,0,FileName[i],-1,wbuf,BUF_SIZE);\r
-                       wcscpy(buf,wbuf);\r
-                       buf += wcslen(wbuf) + 1;\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
-                       lstrcpy(buf,FileName[i]);\r
-                       buf += lstrlen(FileName[i]) + 1;\r
+                       // UTF-8対応\r
+//                     lstrcpy(buf,FileName[i]);\r
+//                     buf += lstrlen(FileName[i]) + 1;\r
+                       MtoW(wbuf, BUF_SIZE, FileName[i], -1);\r
+                       buf += WtoA(buf, BUF_SIZE, wbuf, -1);\r
                }\r
        }\r
 \r
@@ -653,7 +707,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
@@ -661,16 +715,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
@@ -678,16 +732,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
@@ -750,14 +804,17 @@ 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
                        if(hWnd == hWndListRemote)\r
                        {\r
                                if(AskConnecting() == YES)\r
-                                       UpLoadDragProc(wParam);\r
+                                       UploadDragProc(wParam);\r
                        }\r
                        else if(hWnd == hWndListLocal)\r
                        {\r
@@ -782,6 +839,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
@@ -793,9 +853,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
@@ -808,15 +868,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
@@ -829,13 +889,18 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                        char LocDir[FMAX_PATH+1];\r
                                        char *PathDir;\r
  \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
+                                       // 変数が未初期化のバグ修正\r
+                                       FileListBaseNoExpand = NULL;\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
@@ -846,8 +911,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
@@ -857,17 +922,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
+                                       /* ファイル名の配列を作成する */\r
+                                       // TODO: GlobalAllocが返すのはメモリポインタではなくハンドルだが実際は同じ値\r
                                        FileNameList = (char **)GlobalAlloc(GPTR,sizeof(char *) * filenum);\r
                                        if(FileNameList == NULL){\r
                                                abort();\r
@@ -882,7 +953,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
@@ -895,11 +966,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
@@ -908,7 +979,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
@@ -928,7 +999,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
@@ -943,7 +1014,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
@@ -964,7 +1035,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
@@ -1004,13 +1075,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
@@ -1056,13 +1127,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
@@ -1070,6 +1141,9 @@ void GetListTabWidth(void)
        LV_COLUMN LvCol;\r
        int i;\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvCol, 0, sizeof(LV_COLUMN));\r
+\r
        for(i = 0; i <= 3; i++)\r
        {\r
                LvCol.mask = LVCF_WIDTH;\r
@@ -1087,56 +1161,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
@@ -1198,7 +1290,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
@@ -1219,7 +1311,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
@@ -1231,8 +1323,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
@@ -1251,15 +1343,73 @@ 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
+       if(AskDispFileIcon() == YES)\r
+       {\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(ListImgFileIcon);\r
+               ListImgFileIcon = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 0, 1);\r
+               hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr16_bmp));\r
+               ImageList_AddMasked(ListImgFileIcon, 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(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(ListImgFileIcon, FileInfo.hIcon) >= 0)\r
+                               {\r
+                                       Pos->ImageId = ImageId;\r
+                                       ImageId++;\r
+                               }\r
+                               DestroyIcon(FileInfo.hIcon);\r
+                       }\r
+                       Pos = Pos->Next;\r
+               }\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
+       }\r
+       else\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
+\r
 void GetLocalDirForWnd(void)\r
 {\r
        HANDLE fHnd;\r
@@ -1279,7 +1429,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
@@ -1308,11 +1458,11 @@ void GetLocalDirForWnd(void)
                FindClose(fHnd);\r
        }\r
 \r
-       /* \83h\83\89\83C\83u */\r
+       /* ドライブ */\r
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
-               NoDrives = LoadHideDriveListRegistory();\r
+               NoDrives = LoadHideDriveListRegistry();\r
 \r
                Pos = Scan;\r
                while(*Pos != NUL)\r
@@ -1328,32 +1478,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
@@ -1392,15 +1544,36 @@ static void AddDispFileList(FLISTANCHOR *Anchor, char *Name, FILETIME *Time, LON
 \r
                        if((Sort & SORT_GET_ORD) == SORT_ASCENT)\r
                        {\r
-                               if((((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
-                                       ((Cmp = _mbsicmp(GetFileExt(Name), GetFileExt(Pos->File))) < 0)) ||\r
-                                  (((Sort & SORT_MASK_ORD) == SORT_SIZE) &&\r
-                                       ((Cmp = Size - Pos->Size) < 0)) ||\r
-                                  (((Sort & SORT_MASK_ORD) == SORT_DATE) &&\r
-                                       ((Cmp = CompareFileTime(Time, &Pos->Time)) < 0)))\r
-                               {\r
+                               // 読みにくいのでリファクタリング\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
+//                                     ((Cmp = CompareFileTime(Time, &Pos->Time)) < 0)))\r
+//                             {\r
+//                                     break;\r
+//                             }\r
+                               if(((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
+                                       ((Cmp = _mbsicmp(GetFileExt(Name), GetFileExt(Pos->File))) < 0))\r
+                                       break;\r
+#if defined(HAVE_TANDEM)\r
+                               if((AskHostType() == HTYPE_TANDEM) &&\r
+                                       ((Sort & SORT_MASK_ORD) == SORT_EXT) &&\r
+                                       ((Cmp = Attr - Pos->Attr) < 0))\r
+                                       break;\r
+#endif\r
+                               if(((Sort & SORT_MASK_ORD) == SORT_SIZE) &&\r
+                                       ((Cmp = Size - Pos->Size) < 0))\r
+                                       break;\r
+                               if(((Sort & SORT_MASK_ORD) == SORT_DATE) &&\r
+                                       ((Cmp = CompareFileTime(Time, &Pos->Time)) < 0))\r
                                        break;\r
-                               }\r
 \r
                                if(((Sort & SORT_MASK_ORD) == SORT_NAME) || (Cmp == 0))\r
                                {\r
@@ -1412,6 +1585,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
@@ -1458,13 +1636,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
@@ -1486,14 +1664,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
@@ -1507,7 +1685,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
@@ -1519,25 +1699,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
@@ -1545,7 +1727,9 @@ 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
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
+       /* アイコン/ファイル名 */\r
        LvItem.mask = LVIF_TEXT | LVIF_IMAGE;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 0;\r
@@ -1556,9 +1740,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(AskDispFileIcon() == YES && hWnd == GetLocalHwnd())\r
+               LvItem.iImage = ImageId + 5;\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
@@ -1566,7 +1753,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
@@ -1581,18 +1768,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
@@ -1600,7 +1797,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
@@ -1611,13 +1808,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
@@ -1630,14 +1827,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
@@ -1654,6 +1851,8 @@ void SelectFileInList(HWND hWnd, int Type)
        FILETIME Time2;\r
        int Find;\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        Win = WIN_LOCAL;\r
        WinDst = WIN_REMOTE;\r
        if(hWnd == GetRemoteHwnd())\r
@@ -1705,7 +1904,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
@@ -1761,19 +1960,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
@@ -1812,14 +2013,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
@@ -1832,6 +2033,8 @@ void FindFileInList(HWND hWnd, int Type)
        LV_ITEM LvItem;\r
        char *Title;\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        Win = WIN_LOCAL;\r
        Title = MSGJPN050;\r
        if(hWnd == GetRemoteHwnd())\r
@@ -1859,7 +2062,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
@@ -1883,7 +2086,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
@@ -1903,13 +2106,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
@@ -1969,13 +2172,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
@@ -1994,13 +2197,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
@@ -2015,13 +2218,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
@@ -2036,15 +2239,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
@@ -2064,16 +2267,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
@@ -2093,15 +2296,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
@@ -2113,22 +2316,24 @@ int FindNameNode(int Win, char *Name)
        if(Win == WIN_REMOTE)\r
                hWnd = GetRemoteHwnd();\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&FindInfo, 0, sizeof(LV_FINDINFO));\r
        FindInfo.flags = LVFI_STRING;\r
        FindInfo.psz = Name;\r
        return(SendMessage(hWnd, LVM_FINDITEM, -1, (LPARAM)&FindInfo));\r
 }\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
@@ -2140,6 +2345,8 @@ void GetNodeName(int Win, int Pos, char *Buf, int Max)
        if(Win == WIN_REMOTE)\r
                hWnd = GetRemoteHwnd();\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 0;\r
@@ -2150,16 +2357,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
@@ -2173,6 +2380,8 @@ int GetNodeTime(int Win, int Pos, FILETIME *Buf)
        if(Win == WIN_REMOTE)\r
                hWnd = GetRemoteHwnd();\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 1;\r
@@ -2184,16 +2393,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
@@ -2207,6 +2416,8 @@ int GetNodeSize(int Win, int Pos, LONGLONG *Buf)
        if(Win == WIN_REMOTE)\r
                hWnd = GetRemoteHwnd();\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 2;\r
@@ -2215,6 +2426,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
@@ -2225,16 +2443,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
@@ -2247,14 +2465,26 @@ int GetNodeAttr(int Win, int Pos, int *Buf)
        Ret = NO;\r
        if(Win == WIN_REMOTE)\r
        {\r
+               // 変数が未初期化のバグ修正\r
+               memset(&LvItem, 0, sizeof(LV_ITEM));\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
@@ -2263,14 +2493,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
@@ -2284,6 +2514,8 @@ int GetNodeType(int Win, int Pos)
        if(Win == WIN_REMOTE)\r
                hWnd = GetRemoteHwnd();\r
 \r
+       // 変数が未初期化のバグ修正\r
+       memset(&LvItem, 0, sizeof(LV_ITEM));\r
        LvItem.mask = LVIF_TEXT;\r
        LvItem.iItem = Pos;\r
        LvItem.iSubItem = 2;\r
@@ -2302,16 +2534,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
@@ -2321,6 +2553,8 @@ void GetNodeOwner(int Win, int Pos, char *Buf, int Max)
        strcpy(Buf, "");\r
        if(Win == WIN_REMOTE)\r
        {\r
+               // 変数が未初期化のバグ修正\r
+               memset(&LvItem, 0, sizeof(LV_ITEM));\r
                LvItem.mask = LVIF_TEXT;\r
                LvItem.iItem = Pos;\r
                LvItem.iSubItem = 5;\r
@@ -2332,13 +2566,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
@@ -2349,13 +2583,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
@@ -2387,16 +2621,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
@@ -2411,7 +2645,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
@@ -2420,6 +2654,9 @@ void MakeSelectedFileList(int Win, int Expand, int All, FILELIST **Base, int *Ca
                        if((Node == NODE_FILE) ||\r
                           ((Expand == NO) && (Node == NODE_DIR)))\r
                        {\r
+                               // 変数が未初期化のバグ修正\r
+                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                Pkt.InfoExist = 0;\r
                                GetNodeName(Win, Pos, Pkt.File, FMAX_PATH);\r
                                if(GetNodeSize(Win, Pos, &Pkt.Size) == YES)\r
@@ -2449,13 +2686,16 @@ 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
                        {\r
                                if(GetNodeType(Win, Pos) == NODE_DIR)\r
                                {\r
+                                       // 変数が未初期化のバグ修正\r
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                        GetNodeName(Win, Pos, Name, FMAX_PATH);\r
                                        strcpy(Pkt.File, Name);\r
                                        ReplaceAll(Pkt.File, '\\', '/');\r
@@ -2506,8 +2746,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
@@ -2521,15 +2761,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
@@ -2553,14 +2793,26 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
 \r
                if((GetFileAttributes(Name) & FILE_ATTRIBUTE_DIRECTORY) == 0)\r
                {\r
+                       // 変数が未初期化のバグ修正\r
+                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                        Pkt.Node = NODE_FILE;\r
                        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
@@ -2574,6 +2826,9 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
 \r
                if(GetFileAttributes(Name) & FILE_ATTRIBUTE_DIRECTORY)\r
                {\r
+                       // 変数が未初期化のバグ修正\r
+                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                        Pkt.Node = NODE_DIR;\r
                        strcpy(Pkt.File, GetFileName(Name));\r
                        AddFileList(&Pkt, Base);\r
@@ -2589,14 +2844,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
@@ -2612,18 +2867,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
@@ -2632,7 +2887,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
@@ -2643,18 +2898,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
@@ -2664,14 +2919,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
@@ -2693,7 +2948,10 @@ 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
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
+                                       /* まずディレクトリ名をセット */\r
                                        strcpy(Pkt.File, Pos->File);\r
                                        Pkt.Node = NODE_DIR;\r
                                        Pkt.Size = 0;\r
@@ -2701,7 +2959,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
@@ -2713,18 +2971,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
@@ -2740,16 +2998,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
@@ -2775,14 +3033,17 @@ 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
+                                               // 変数が未初期化のバグ修正\r
+                                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                                strcpy(Pkt.File, Dir);\r
                                                Pkt.Node = NODE_DIR;\r
                                                Pkt.Size = 0;\r
@@ -2801,6 +3062,9 @@ void AddRemoteTreeToFileList(int Num, char *Path, int IncDir, FILELIST **Base)
                                        if((Node == NODE_FILE) ||\r
                                           ((IncDir == RDIR_CWD) && (Node == NODE_DIR)))\r
                                        {\r
+                                               // 変数が未初期化のバグ修正\r
+                                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                                strcpy(Pkt.File, Dir);\r
                                                if(strlen(Pkt.File) > 0)\r
                                                        SetSlashTail(Pkt.File);\r
@@ -2822,19 +3086,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
@@ -2842,19 +3106,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
@@ -2882,24 +3146,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
@@ -2907,7 +3171,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
@@ -2929,7 +3193,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
@@ -2937,14 +3201,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
@@ -2968,6 +3232,9 @@ static void MakeLocalTree(char *Path, FILELIST **Base)
                        {\r
                                if(AskFilterStr(FindBuf.cFileName, NODE_FILE) == YES)\r
                                {\r
+                                       // 変数が未初期化のバグ修正\r
+                                       memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                        strcpy(Pkt.File, Path);\r
                                        SetSlashTail(Pkt.File);\r
                                        strcat(Pkt.File, FindBuf.cFileName);\r
@@ -2996,6 +3263,9 @@ static void MakeLocalTree(char *Path, FILELIST **Base)
                           (strcmp(FindBuf.cFileName, ".") != 0) &&\r
                           (strcmp(FindBuf.cFileName, "..") != 0))\r
                        {\r
+                               // 変数が未初期化のバグ修正\r
+                               memset(&Pkt, 0, sizeof(FILELIST));\r
+\r
                                strcpy(Src, Path);\r
                                SetYenTail(Src);\r
                                strcat(Src, FindBuf.cFileName);\r
@@ -3017,14 +3287,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
@@ -3034,7 +3304,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
@@ -3047,7 +3317,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
@@ -3064,13 +3334,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
@@ -3090,16 +3360,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
@@ -3134,13 +3404,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
@@ -3173,17 +3443,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
@@ -3200,14 +3470,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
@@ -3220,7 +3490,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
@@ -3233,7 +3503,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
@@ -3244,7 +3514,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
@@ -3254,7 +3524,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
@@ -3264,7 +3534,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
@@ -3273,26 +3543,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
@@ -3301,24 +3586,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
@@ -3328,21 +3613,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
@@ -3351,20 +3636,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
@@ -3378,18 +3663,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
@@ -3398,21 +3683,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
@@ -3421,20 +3706,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
@@ -3444,21 +3729,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
@@ -3467,37 +3752,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
@@ -3506,23 +3791,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
@@ -3533,21 +3818,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
@@ -3556,19 +3841,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
@@ -3576,7 +3861,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
@@ -3585,17 +3892,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
@@ -3609,37 +3916,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
@@ -3647,7 +3954,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
@@ -3739,18 +4046,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
@@ -3771,22 +4078,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
@@ -3828,18 +4135,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
@@ -3861,21 +4168,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
@@ -3897,8 +4204,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
@@ -3926,7 +4235,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
@@ -3951,7 +4260,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
@@ -3962,12 +4271,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
@@ -3978,13 +4287,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
@@ -3994,12 +4303,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
@@ -4010,7 +4319,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
@@ -4021,7 +4330,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
@@ -4029,12 +4338,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
@@ -4046,20 +4355,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
@@ -4068,12 +4377,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
@@ -4084,18 +4393,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
@@ -4103,12 +4412,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
@@ -4122,12 +4431,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
@@ -4146,8 +4455,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
@@ -4162,18 +4471,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
@@ -4181,16 +4490,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
@@ -4200,7 +4509,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
@@ -4208,11 +4517,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
@@ -4224,7 +4533,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
@@ -4232,8 +4541,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
@@ -4246,21 +4555,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
@@ -4269,12 +4578,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
@@ -4284,7 +4593,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
@@ -4303,15 +4612,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
@@ -4320,21 +4629,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
@@ -4348,21 +4657,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
@@ -4374,36 +4683,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
@@ -4414,15 +4723,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
@@ -4431,12 +4740,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
@@ -4447,7 +4756,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
@@ -4455,7 +4764,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
@@ -4464,19 +4773,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
@@ -4489,7 +4798,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
@@ -4501,9 +4810,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
@@ -4515,20 +4824,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
@@ -4539,20 +4848,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
@@ -4561,12 +4870,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
@@ -4574,6 +4883,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
@@ -4601,10 +5046,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
@@ -4635,8 +5082,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
@@ -4645,10 +5102,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
@@ -4680,15 +5138,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
@@ -4707,20 +5165,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
@@ -4733,7 +5201,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
@@ -4741,18 +5209,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
-                      &nb