Changeset 785
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/grep.c
r783 r785 23 23 13 Aug 07 SHL Avoid pointer errors; sanitize code 24 24 13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat 25 15 Aug 07 SHL Use FilesToGet directly 25 26 26 27 ***********************************************************************/ … … 244 245 grep = *(GREP *)arg; 245 246 *grep.stopflag = 0; // reset thread-killing flag 246 grep.FilesToGet = FilesToGet;247 247 DosError(FERR_DISABLEHARDERR); 248 248 priority_normal(); … … 460 460 PSZ p; 461 461 APIRET rc; 462 ULONG ulBufBytes = grep->FilesToGet * sizeof(FILEFINDBUF4);462 ULONG ulBufBytes = FilesToGet * sizeof(FILEFINDBUF4); 463 463 464 464 pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__); … … 484 484 // step through matching files 485 485 DosError(FERR_DISABLEHARDERR); 486 ulFindCnt = grep->FilesToGet;486 ulFindCnt = FilesToGet; 487 487 rc = DosFindFirst(szFindPath, 488 488 &findHandle, … … 520 520 break; 521 521 DosSleep(1); 522 ulFindCnt = grep->FilesToGet;522 ulFindCnt = FilesToGet; 523 523 rc = DosFindNext(findHandle, pffbArray, ulBufBytes, &ulFindCnt); 524 524 } while (!rc); … … 596 596 DosExitCritSec(); 597 597 } 598 if (grep->toinsert == grep->FilesToGet)598 if (grep->toinsert == FilesToGet) 599 599 DosSleep(1); 600 600 freegreplist(grep); … … 621 621 if (!grep->insertffb) { 622 622 // 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__); 626 625 if (!grep->insertffb) 627 626 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__); 631 629 if (!grep->dir) { 632 630 free(grep->insertffb); … … 646 644 grep->insertedbytes += pffb->cbFile + CBLIST_TO_EASIZE(pffb->cbList); 647 645 grep->toinsert++; 648 if (grep->toinsert == grep->FilesToGet)646 if (grep->toinsert == FilesToGet) 649 647 return doinsertion(grep); 650 648 return TRUE; -
trunk/dll/grep.h
r551 r785 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2006 Steven H. Levine9 Copyright (c) 2006, 2007 Steven H. Levine 10 10 11 04 Nov 06 Renames 11 04 Nov 06 SHL Renames 12 15 Aug 07 SHL Drop obsoletes 12 13 13 14 ***********************************************************************/ … … 67 68 ULONG antiattr; 68 69 DUPES *dupehead, *dupelast, **dupenames, **dupesizes; 69 ULONG FilesToGet;70 70 CHAR searchPattern[4096]; 71 71 ULONG numlines;
Note:
See TracChangeset
for help on using the changeset viewer.