Changeset 336 for trunk/dll/grep2.c


Ignore:
Timestamp:
Jul 26, 2006, 3:41:41 AM (19 years ago)
Author:
root
Message:

Use Runtime_Error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/grep2.c

    r202 r336  
    55
    66  Copyright (c) 1993-98 M. Kimes
    7   Copyright (c) 2004, 2005 Steven H. Levine
     7  Copyright (c) 2004, 2006 Steven H. Levine
    88
    99  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    1111  06 Jun 05 SHL Indent -i2
    1212  06 Jun 05 SHL Rework for VAC3.65 compat, lose excess statics
     13  17 Jul 06 SHL Use Runtime_Error
    1314
    1415  fixme for more excess locals to be gone
     
    3839
    3940#pragma data_seg(DATA1)
     41
     42static PSZ pszSrcFile = __FILE__;
     43
    4044#pragma alloc_text(GREP,GrepDlgProc,EnvDlgProc)
    4145
     
    152156                            p);
    153157        bstrip(p);
    154         if (*p)
    155         {
     158        if (!*p) {
     159          DosBeep(50, 100);
     160          WinSetFocus(HWND_DESKTOP,
     161                      WinWindowFromID(hwnd, ENV_NAME));
     162        }
     163        else {
    156164          strcpy(lastenv, p);
    157165          WinDismissDlg(hwnd, 1);
    158         }
    159         else
    160         {
    161           DosBeep(250, 100);
    162           WinSetFocus(HWND_DESKTOP,
    163                       WinWindowFromID(hwnd, ENV_NAME));
    164166        }
    165167      }
     
    366368        if (strlen(s) > 8192 - lLen)
    367369        {
    368           DosBeep(250, 100);
     370          Runtime_Error(pszSrcFile, __LINE__, "too big");
    369371          WinSetDlgItemText(hwnd,
    370372                            GREP_MASK,
     
    593595        if (strlen(s) > 8192 - 5)
    594596        {
    595           DosBeep(50, 100);
     597          Runtime_Error(pszSrcFile, __LINE__, "too big");
    596598          break;
    597599        }
     
    668670      if (strlen(s) > 8192 - 5)
    669671      {
    670         DosBeep(50, 100);
     672        Runtime_Error(pszSrcFile, __LINE__, "too big");
    671673        break;
    672674      }
     
    694696        if (strlen(s) > (8192 - lLen) - (strlen(path) + 1))
    695697        {
    696           DosBeep(250, 100);
     698          Runtime_Error(pszSrcFile, __LINE__, "too big");
    697699          WinSetDlgItemText(hwnd,
    698700                            GREP_MASK,
     
    914916      hwndCollect = WinQueryWindowULong(hwnd, QWL_USER);
    915917      if (!hwndCollect)
    916         DosBeep(50, 100);
     918        Runtime_Error(pszSrcFile, __LINE__, "no data");
    917919      else
    918920      {
    919921        static GREP g;          // Passed to thread
    920922
    921         p = malloc(8192 + 512);
     923        p = xmalloc(8192 + 512,pszSrcFile,__LINE__);
    922924        if (!p)
    923         {
    924           DosBeep(50, 100);
    925925          break;
    926         }
    927926        memset(&g, 0, sizeof(GREP));
    928927        g.size = sizeof(GREP);
     
    10251024          *pszTo = 0;
    10261025          g.numlines = matched;
    1027           g.matched = malloc(g.numlines);
     1026          g.matched = xmalloc(g.numlines,pszSrcFile,__LINE__);
    10281027          if (!g.matched)
    10291028            g.numlines = 0;
     
    11001099        if (_beginthread(dogrep, NULL, 524280, (PVOID)&g) == -1)
    11011100        {
     1101          Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
    11021102          free(p);
    1103           DosBeep(50, 100);
    11041103          WinDismissDlg(hwnd, 0);
    11051104          break;
     
    11241123            strcat(s, "\\");
    11251124          strcat(s, "GREPMASK.DAT");
    1126           fp = fopen(s, "w");
     1125          fp = xfopen(s, "w",pszSrcFile,__LINE__);
    11271126          if (fp)
    11281127          {
Note: See TracChangeset for help on using the changeset viewer.