Changeset 876


Ignore:
Timestamp:
Dec 5, 2003, 4:05:59 AM (22 years ago)
Author:
bird
Message:

Workaround for bad FIL_STANDARDL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/sys/filefind.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r875 r876  
    135135     * Start file enumeration.
    136136     */
    137     pFD->cFiles = 30; /* !! Careful with this number! Wrong values can trigger stupid bugs. */
     137    pFD->cFiles = sizeof(pFD->achBuffer) / 32;
     138    pFD->cFiles = sizeof(pFD->achBuffer) / 40;
    138139#if OFF_MAX > LONG_MAX
    139140    pFD->fType = __pfnDosOpenL ? FIL_STANDARDL : FIL_STANDARD;
     141    if (pFD->fType == FIL_STANDARDL)  /* the L version is buggy!! Make sure there is enough space. */
     142        pFD->cFiles = sizeof(pFD->achBuffer) / sizeof(FILEFINDBUF3L);
    140143#else
    141144    pFD->fType = FIL_STANDARD;
    142145#endif
    143146    FS_SAVE_LOAD();
     147    memset(&pFD->achBuffer[0], 0, sizeof(pFD->achBuffer));
    144148    rc = DosFindFirst(pszName,
    145149                      &pFD->hdir,
     
    195199    if (!pFD->cFiles)
    196200    {
    197         pFD->cFiles = 30; /* !! Careful with this number! Wrong values can trigger stupid bugs. */
     201        pFD->cFiles = sizeof(pFD->achBuffer) / 40;
     202        if (pFD->fType == FIL_STANDARDL)  /* the L version is buggy!! Make sure there is enough space. */
     203            pFD->cFiles = sizeof(pFD->achBuffer) / sizeof(FILEFINDBUF3L);
    198204        FS_SAVE_LOAD();
    199205        rc = DosFindNext(pFD->hdir, &pFD->achBuffer[0], sizeof(pFD->achBuffer), &pFD->cFiles);
Note: See TracChangeset for help on using the changeset viewer.