Changeset 924 for trunk/dll/filldir.c


Ignore:
Timestamp:
Jan 17, 2008, 1:40:52 AM (18 years ago)
Author:
Steven Levine
Message:

Avoid error reports for R/O FAT directories (ticket #116)
Change Config->Edit and Config->Palette menus to have no default
Move SpecialSelect to comp.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r917 r924  
    747747      ulFindMax = FilesToGet;           // full-out
    748748  }
    749   else {
     749  else
    750750    ulFindMax = FilesToGet;
    751   }
     751
    752752  if (OS2ver[0] == 20 && OS2ver[1] < 30)
    753753    ulFindMax = min(ulFindMax, (65535 / sizeof(FILEFINDBUF4L)));
     
    780780                       FIL_QUERYEASIZEL);
    781781    priority_normal();
    782     *pchEndPath = 0;
     782    *pchEndPath = 0;                    // Chop off wildcard
    783783    if (!rc) {
    784784      do {
     
    971971    }
    972972
     973    /**
     974     * DosFind for subdirectories of a read-only directory on a FAT volume
     975     * returns path not found if there are no subdirectories
     976     * FAT FS seems to ignore . and .. in this case
     977     * Map to no more files
     978     * We could verify that directory is marked read-only, it's probably not
     979     * worth the extra code since we do verify 2 out of 3 prerequisites
     980     * 15 Jan 08 SHL
     981     */
     982    if (rc == ERROR_PATH_NOT_FOUND && !filestoo) {
     983      ULONG ulDriveType = 0;
     984      CHAR szFSType[CCHMAXPATH];
     985      INT removable = CheckDrive(*pszFileSpec, szFSType, &ulDriveType);
     986      if (removable != -1 && strcmp(szFSType, "FAT") == 0)
     987        rc = ERROR_NO_MORE_FILES;
     988    }
     989
    973990    if (rc && rc != ERROR_NO_MORE_FILES) {
    974991      Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     
    10111028VOID FillDirCnr(HWND hwndCnr,
    10121029                CHAR * pszDirectory,
    1013                 DIRCNRDATA * dcd, PULONGLONG pullTotalBytes)
     1030                DIRCNRDATA * dcd,
     1031                PULONGLONG pullTotalBytes)
    10141032{
    10151033  ProcessDirectory(hwndCnr,
    1016                    (PCNRITEM) NULL,
     1034                   (PCNRITEM)NULL,
    10171035                   pszDirectory,
    10181036                   TRUE,                // filestoo
     
    10211039                   dcd ? &dcd->stopflag : NULL,
    10221040                   dcd,
    1023                    NULL,
     1041                   NULL,                // total files
    10241042                   pullTotalBytes);
    10251043  DosPostEventSem(CompactSem);
     
    10391057VOID FillTreeCnr(HWND hwndCnr, HWND hwndParent)
    10401058{
    1041   ULONG ulCurDriveNum, ulDriveMap, numtoinsert = 0, drvtype;
     1059  ULONG ulCurDriveNum, ulDriveMap, numtoinsert = 0;
     1060  ULONG ulDriveType;
    10421061  PCNRITEM pci, pciFirst = NULL, pciNext, pciParent = NULL;
    10431062  INT x, removable;
    10441063  CHAR suggest[32];
    10451064  CHAR szDrive[] = " :\\";
    1046   CHAR szFileSystem[CCHMAXPATH];
     1065  CHAR szFSType[CCHMAXPATH];
    10471066  FILESTATUS4L fsa4;
    10481067  APIRET rc;
     
    11201139        // Hard drive (2..N)
    11211140        if (!(driveflags[x] & DRIVE_NOPRESCAN)) {
    1122           *szFileSystem = 0;
    1123           drvtype = 0;
    1124           removable = CheckDrive(*szDrive, szFileSystem, &drvtype);
     1141          *szFSType = 0;
     1142          ulDriveType = 0;
     1143          removable = CheckDrive(*szDrive, szFSType, &ulDriveType);
    11251144          driveserial[x] = -1;
    11261145          if (removable != -1) {
     
    11431162          driveflags[x] |= removable == -1 || removable == 1 ?
    11441163                            DRIVE_REMOVABLE : 0;
    1145           if (drvtype & DRIVE_REMOTE)
     1164          if (ulDriveType & DRIVE_REMOTE)
    11461165            driveflags[x] |= DRIVE_REMOTE;
    1147           if (!stricmp(szFileSystem,RAMFS)) {
     1166          if (!stricmp(szFSType,RAMFS)) {
    11481167            driveflags[x] |= DRIVE_RAMDISK;
    11491168            driveflags[x] &= ~DRIVE_REMOTE;
    11501169          }
    1151           if (!stricmp(szFileSystem,NDFS32)) {
     1170          if (!stricmp(szFSType,NDFS32)) {
    11521171            driveflags[x] |= DRIVE_VIRTUAL;
    11531172            driveflags[x] &= ~DRIVE_REMOTE;
    11541173          }
    1155           if (!stricmp(szFileSystem,NTFS))
     1174          if (!stricmp(szFSType,NTFS))
    11561175            driveflags[x] |= DRIVE_NOTWRITEABLE;
    1157           if (strcmp(szFileSystem, HPFS) &&
    1158               strcmp(szFileSystem, JFS) &&
    1159               strcmp(szFileSystem, ISOFS) &&
    1160               strcmp(szFileSystem, CDFS) &&
    1161               strcmp(szFileSystem, FAT32) &&
    1162               strcmp(szFileSystem, NDFS32) &&
    1163               strcmp(szFileSystem, RAMFS) &&
    1164               strcmp(szFileSystem, NTFS) &&
    1165               strcmp(szFileSystem, HPFS386)) {
     1176          if (strcmp(szFSType, HPFS) &&
     1177              strcmp(szFSType, JFS) &&
     1178              strcmp(szFSType, ISOFS) &&
     1179              strcmp(szFSType, CDFS) &&
     1180              strcmp(szFSType, FAT32) &&
     1181              strcmp(szFSType, NDFS32) &&
     1182              strcmp(szFSType, RAMFS) &&
     1183              strcmp(szFSType, NTFS) &&
     1184              strcmp(szFSType, HPFS386)) {
    11661185            driveflags[x] |= DRIVE_NOLONGNAMES;
    11671186          }
    11681187
    1169           if (!strcmp(szFileSystem, CDFS) || !strcmp(szFileSystem,ISOFS)) {
     1188          if (!strcmp(szFSType, CDFS) || !strcmp(szFSType,ISOFS)) {
    11701189            removable = 1;
    11711190            driveflags[x] |= DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
    11721191                             DRIVE_CDROM;
    11731192          }
    1174           else if (!stricmp(szFileSystem, CBSIFS)) {
     1193          else if (!stricmp(szFSType, CBSIFS)) {
    11751194            driveflags[x] |= DRIVE_ZIPSTREAM;
    11761195            driveflags[x] &= ~DRIVE_REMOTE;
    1177             if (drvtype & DRIVE_REMOVABLE)
     1196            if (ulDriveType & DRIVE_REMOVABLE)
    11781197              driveflags[x] |= DRIVE_REMOVABLE;
    1179             if (!(drvtype & DRIVE_NOLONGNAMES))
     1198            if (!(ulDriveType & DRIVE_NOLONGNAMES))
    11801199              driveflags[x] &= ~DRIVE_NOLONGNAMES;
    11811200          }
     
    13381357          p++;
    13391358        while (*p) {
    1340           *szFileSystem = 0;
    1341           pp = szFileSystem;
     1359          *szFSType = 0;
     1360          pp = szFSType;
    13421361          while (*p && *p != ' ')
    13431362            *pp++ = *p++;
     
    13451364          while (*p == ' ')
    13461365            p++;
    1347           if (*szFileSystem &&
    1348               (!stricmp(szFileSystem, "LIBPATH") || getenv(szFileSystem))) {
     1366          if (*szFSType &&
     1367              (!stricmp(szFSType, "LIBPATH") || getenv(szFSType))) {
    13491368            pci = WinSendMsg(hwndCnr,
    13501369                             CM_ALLOCRECORD,
     
    13541373              CHAR fname[CCHMAXPATH];
    13551374              pci->flags |= RECFLAGS_ENV;
    1356               sprintf(fname, "%%%s%%", szFileSystem);
     1375              sprintf(fname, "%%%s%%", szFSType);
    13571376              pci->pszFileName = xstrdup(fname, pszSrcFile, __LINE__);
    13581377              pci->rc.hptrIcon = hptrEnv;
     
    14301449    x++;
    14311450    pci = pciNext;
    1432   }
     1451  } // while
    14331452  if (hwndParent)
    14341453    WinSendMsg(WinWindowFromID(WinQueryWindow(hwndParent, QW_PARENT),
Note: See TracChangeset for help on using the changeset viewer.