OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / filelist.c
index 6b1072a..b3e1da2 100644 (file)
@@ -83,7 +83,9 @@ 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
+// ファイルアイコン表示対応\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
@@ -145,6 +147,8 @@ 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] = { "*" };           /* 検索文字列 */\r
 static int IgnoreNew = NO;\r
@@ -444,9 +448,11 @@ 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
        // すでにリモートから転送済みなら何もしない。(2007.9.3 yutaka)\r
        if (remoteFileListBase != NULL)\r
@@ -462,10 +468,15 @@ static void doTransferRemoteFile(void)
 \r
        // アプリを多重起動してもコンフリクトしないように、テンポラリフォルダ名にプロセスID\r
        // を付加する。(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
+       // 環境依存の不具合対策\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
@@ -777,6 +788,9 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        return(CallWindowProc(ProcPtr, hWnd, message, wParam, lParam));\r
 \r
                case WM_DROPFILES :\r
+                       // 同時接続対応\r
+                       if(AskUserOpeDisabled() == YES)\r
+                               break;\r
                        // ドラッグ中は処理しない。ドラッグ後にWM_LBUTTONDOWNが飛んでくるため、そこで処理する。\r
                        if (Dragging == YES) \r
                                return (FALSE);\r
@@ -784,7 +798,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        if(hWnd == hWndListRemote)\r
                        {\r
                                if(AskConnecting() == YES)\r
-                                       UpLoadDragProc(wParam);\r
+                                       UploadDragProc(wParam);\r
                        }\r
                        else if(hWnd == hWndListLocal)\r
                        {\r
@@ -809,6 +823,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
@@ -889,6 +906,11 @@ 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
@@ -1311,6 +1333,64 @@ void GetRemoteDirForWnd(int Mode, int *CancelCheckWork)
 *              なし\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
@@ -1363,7 +1443,7 @@ void GetLocalDirForWnd(void)
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
-               NoDrives = LoadHideDriveListRegistory();\r
+               NoDrives = LoadHideDriveListRegistry();\r
 \r
                Pos = Scan;\r
                while(*Pos != NUL)\r
@@ -1379,6 +1459,8 @@ void GetLocalDirForWnd(void)
                }\r
        }\r
 \r
+       // ファイルアイコン表示対応\r
+       RefreshIconImageList(&Anchor);\r
        DispFileList2View(GetLocalHwnd(), &Anchor);\r
        EraseDispFileList(&Anchor);\r
 \r
@@ -1445,6 +1527,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
@@ -1463,6 +1550,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
@@ -1558,7 +1650,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
@@ -1588,7 +1682,9 @@ static void DispFileList2View(HWND hWnd, FLISTANCHOR *Anchor)
 *              なし\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
@@ -1607,6 +1703,9 @@ 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
        /* 日付/時刻 */\r
@@ -1636,6 +1735,12 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        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
@@ -1643,7 +1748,11 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        {\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
@@ -2268,6 +2377,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
@@ -2302,12 +2418,22 @@ int GetNodeAttr(int Win, int Pos, int *Buf)
        {\r
                LvItem.mask = LVIF_TEXT;\r
                LvItem.iItem = Pos;\r
+#if defined(HAVE_TANDEM)\r
+               if(AskHostType() == HTYPE_TANDEM)\r
+                       LvItem.iSubItem = 3;\r
+               else\r
+#endif\r
                LvItem.iSubItem = 4;\r
                LvItem.pszText = Tmp;\r
                LvItem.cchTextMax = 20;\r
                SendMessage(GetRemoteHwnd(), LVM_GETITEM, 0, (LPARAM)&LvItem);\r
                if(strlen(Tmp) > 0)\r
                {\r
+#if defined(HAVE_TANDEM)\r
+                       if(AskHostType() == HTYPE_TANDEM)\r
+                               *Buf = atoi(Tmp);\r
+                       else\r
+#endif\r
                        *Buf = AttrString2Value(Tmp);\r
                        Ret = YES;\r
                }\r
@@ -2610,10 +2736,19 @@ void MakeDroppedFileList(WPARAM wParam, char *Cur, FILELIST **Base)
                        strcpy(Pkt.File, GetFileName(Name));\r
 \r
                        memset(&Pkt.Time, 0, sizeof(FILETIME));\r
+#if defined(HAVE_TANDEM)\r
+                       /* Guardian スペースへのアップロードのためにサイズが必要 */\r
+                       Pkt.Size = 0;\r
+                       Pkt.InfoExist = 0;\r
+#endif\r
                        if((fHnd = FindFirstFile(Name, &Find)) != INVALID_HANDLE_VALUE)\r
                        {\r
                                FindClose(fHnd);\r
                                Pkt.Time = Find.ftLastWriteTime;\r
+#if defined(HAVE_TANDEM)\r
+                               Pkt.Size = MakeLongLong(Find.nFileSizeHigh, Find.nFileSizeLow);\r
+                               Pkt.InfoExist |= (FINFO_TIME | FINFO_DATE | FINFO_SIZE);\r
+#endif\r
                        }\r
                        AddFileList(&Pkt, Base);\r
                }\r
@@ -3326,6 +3461,21 @@ 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
@@ -3629,6 +3779,20 @@ 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
@@ -3960,6 +4124,8 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \r
        /* まずクリアしておく */\r
        Ret = NODE_NONE;\r
+       // バグ対策\r
+       memset(Fname, NUL, FMAX_PATH+1);\r
        *Size = -1;\r
        *Attr = 0;\r
        *Link = NO;\r
@@ -4635,6 +4801,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
@@ -4664,6 +4966,8 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                case LIST_UNIX_75 :\r
 // MELCOMはビットフラグになっている\r
 //             case LIST_MELCOM :\r
+               // linux-ftpd\r
+               case LIST_UNIX_16 :\r
                default:\r
                        /* offsはサイズの位置, offs=0はカラム4 */\r
                        offs = 0;\r
@@ -4698,6 +5002,16 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
 \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
@@ -4706,7 +5020,8 @@ 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はオーナ名の位置 */\r
@@ -4784,6 +5099,16 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                        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
                                {\r
                                        GetMonth(Buf, &sTime.wMonth, &sTime.wDay);\r
@@ -4877,56 +5202,6 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                        Ret = NODE_NONE;\r
                        }\r
                        break;\r
-\r
-                       // MLSD対応\r
-               case LIST_MLSD:\r
-                       {\r
-                               int i = 0;\r
-                               char Tmp[FMAX_PATH + 1];\r
-                               char Name[FMAX_PATH + 1];\r
-                               char Value[FMAX_PATH + 1];\r
-                               while(FindField2(Str, Tmp, ';', i, NO) == FFFTP_SUCCESS)\r
-                               {\r
-                                       if(i >= 1 && strncmp(Tmp, " ", 1) == 0)\r
-                                               strcpy(Fname, strstr(Str, "; ") + 2);\r
-                                       else if(FindField2(Tmp, Name, '=', 0, NO) == FFFTP_SUCCESS && FindField2(Tmp, 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
-                                                       SystemTimeToFileTime(&sTime, Time);\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
 \r
        // UTF-8対応\r