Changeset 785 for trunk/dll/grep.c


Ignore:
Timestamp:
Aug 18, 2007, 5:06:17 PM (18 years ago)
Author:
Steven Levine
Message:

Use FilesToGet directly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/grep.c

    r783 r785  
    2323  13 Aug 07 SHL Avoid pointer errors; sanitize code
    2424  13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat
     25  15 Aug 07 SHL Use FilesToGet directly
    2526
    2627***********************************************************************/
     
    244245  grep = *(GREP *)arg;
    245246  *grep.stopflag = 0;                   // reset thread-killing flag
    246   grep.FilesToGet = FilesToGet;
    247247  DosError(FERR_DISABLEHARDERR);
    248248  priority_normal();
     
    460460  PSZ p;
    461461  APIRET rc;
    462   ULONG ulBufBytes = grep->FilesToGet * sizeof(FILEFINDBUF4);
     462  ULONG ulBufBytes = FilesToGet * sizeof(FILEFINDBUF4);
    463463
    464464  pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__);
     
    484484  // step through matching files
    485485  DosError(FERR_DISABLEHARDERR);
    486   ulFindCnt = grep->FilesToGet;
     486  ulFindCnt = FilesToGet;
    487487  rc = DosFindFirst(szFindPath,
    488488                    &findHandle,
     
    520520        break;
    521521      DosSleep(1);
    522       ulFindCnt = grep->FilesToGet;
     522      ulFindCnt = FilesToGet;
    523523      rc = DosFindNext(findHandle, pffbArray, ulBufBytes, &ulFindCnt);
    524524    } while (!rc);
     
    596596      DosExitCritSec();
    597597    }
    598     if (grep->toinsert == grep->FilesToGet)
     598    if (grep->toinsert == FilesToGet)
    599599      DosSleep(1);
    600600    freegreplist(grep);
     
    621621      if (!grep->insertffb) {
    622622        // Allocate 1 extra for end marker?
    623         grep->insertffb =
    624           xmallocz(sizeof(PFILEFINDBUF4) * (grep->FilesToGet + 1),
    625                           pszSrcFile, __LINE__);
     623        grep->insertffb = xmallocz(sizeof(PFILEFINDBUF4) * (FilesToGet + 1),
     624                                   pszSrcFile, __LINE__);
    626625        if (!grep->insertffb)
    627626          return FALSE;
    628         grep->dir =
    629           xmallocz(sizeof(CHAR *) * (grep->FilesToGet + 1),
    630                    pszSrcFile, __LINE__);
     627        grep->dir = xmallocz(sizeof(CHAR *) * (FilesToGet + 1),
     628                             pszSrcFile, __LINE__);
    631629        if (!grep->dir) {
    632630          free(grep->insertffb);
     
    646644      grep->insertedbytes += pffb->cbFile + CBLIST_TO_EASIZE(pffb->cbList);
    647645      grep->toinsert++;
    648       if (grep->toinsert == grep->FilesToGet)
     646      if (grep->toinsert == FilesToGet)
    649647        return doinsertion(grep);
    650648      return TRUE;
Note: See TracChangeset for help on using the changeset viewer.