Changeset 336 for trunk/dll/grep2.c
- Timestamp:
- Jul 26, 2006, 3:41:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/grep2.c
r202 r336 5 5 6 6 Copyright (c) 1993-98 M. Kimes 7 Copyright (c) 2004, 200 5Steven H. Levine7 Copyright (c) 2004, 2006 Steven H. Levine 8 8 9 9 01 Aug 04 SHL Rework lstrip/rstrip usage … … 11 11 06 Jun 05 SHL Indent -i2 12 12 06 Jun 05 SHL Rework for VAC3.65 compat, lose excess statics 13 17 Jul 06 SHL Use Runtime_Error 13 14 14 15 fixme for more excess locals to be gone … … 38 39 39 40 #pragma data_seg(DATA1) 41 42 static PSZ pszSrcFile = __FILE__; 43 40 44 #pragma alloc_text(GREP,GrepDlgProc,EnvDlgProc) 41 45 … … 152 156 p); 153 157 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 { 156 164 strcpy(lastenv, p); 157 165 WinDismissDlg(hwnd, 1); 158 }159 else160 {161 DosBeep(250, 100);162 WinSetFocus(HWND_DESKTOP,163 WinWindowFromID(hwnd, ENV_NAME));164 166 } 165 167 } … … 366 368 if (strlen(s) > 8192 - lLen) 367 369 { 368 DosBeep(250, 100);370 Runtime_Error(pszSrcFile, __LINE__, "too big"); 369 371 WinSetDlgItemText(hwnd, 370 372 GREP_MASK, … … 593 595 if (strlen(s) > 8192 - 5) 594 596 { 595 DosBeep(50, 100);597 Runtime_Error(pszSrcFile, __LINE__, "too big"); 596 598 break; 597 599 } … … 668 670 if (strlen(s) > 8192 - 5) 669 671 { 670 DosBeep(50, 100);672 Runtime_Error(pszSrcFile, __LINE__, "too big"); 671 673 break; 672 674 } … … 694 696 if (strlen(s) > (8192 - lLen) - (strlen(path) + 1)) 695 697 { 696 DosBeep(250, 100);698 Runtime_Error(pszSrcFile, __LINE__, "too big"); 697 699 WinSetDlgItemText(hwnd, 698 700 GREP_MASK, … … 914 916 hwndCollect = WinQueryWindowULong(hwnd, QWL_USER); 915 917 if (!hwndCollect) 916 DosBeep(50, 100);918 Runtime_Error(pszSrcFile, __LINE__, "no data"); 917 919 else 918 920 { 919 921 static GREP g; // Passed to thread 920 922 921 p = malloc(8192 + 512);923 p = xmalloc(8192 + 512,pszSrcFile,__LINE__); 922 924 if (!p) 923 {924 DosBeep(50, 100);925 925 break; 926 }927 926 memset(&g, 0, sizeof(GREP)); 928 927 g.size = sizeof(GREP); … … 1025 1024 *pszTo = 0; 1026 1025 g.numlines = matched; 1027 g.matched = malloc(g.numlines);1026 g.matched = xmalloc(g.numlines,pszSrcFile,__LINE__); 1028 1027 if (!g.matched) 1029 1028 g.numlines = 0; … … 1100 1099 if (_beginthread(dogrep, NULL, 524280, (PVOID)&g) == -1) 1101 1100 { 1101 Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT)); 1102 1102 free(p); 1103 DosBeep(50, 100);1104 1103 WinDismissDlg(hwnd, 0); 1105 1104 break; … … 1124 1123 strcat(s, "\\"); 1125 1124 strcat(s, "GREPMASK.DAT"); 1126 fp = fopen(s, "w");1125 fp = xfopen(s, "w",pszSrcFile,__LINE__); 1127 1126 if (fp) 1128 1127 {
Note:
See TracChangeset
for help on using the changeset viewer.