Changeset 328 for trunk/dll/walkem.c
- Timestamp:
- Jul 25, 2006, 8:37:24 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/dll/walkem.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/walkem.c
r259 r328 5 5 6 6 Copyright (c) 1993-98 M. Kimes 7 Copyright (c) 2005, 200 4, 2005Steven H. Levine7 Copyright (c) 2005, 2006 Steven H. Levine 8 8 9 9 01 Aug 04 SHL Rework lstrip/rstrip usage … … 11 11 13 Aug 05 SHL Run through indent 12 12 13 Aug 05 SHL remove_udir - avoid corrupting last dirs list 13 17 Jul 06 SHL Use Runtime_Error 13 14 14 15 ***********************************************************************/ … … 31 32 32 33 #pragma data_seg(DATA1) 34 35 static PSZ pszSrcFile = __FILE__; 36 33 37 #pragma alloc_text(WALKER,FillPathListBox,WalkDlgProc,TextSubProc) 34 38 #pragma alloc_text(WALKER,WalkAllDlgProc,WalkCopyDlgProc) … … 157 161 if (*s && *s != ';') 158 162 { 159 info = malloc(sizeof(LINKDIRS)); 160 if (info) 161 { 162 info -> path = strdup(s); 163 if (info -> path) 163 info = xmalloc(sizeof(LINKDIRS),pszSrcFile,__LINE__); 164 if (info) { 165 info -> path = xstrdup(s,pszSrcFile,__LINE__); 166 if (!info -> path) 167 free(info); 168 else 164 169 { 165 170 info -> next = NULL; … … 170 175 last = info; 171 176 } 172 else173 free(info);174 177 } 175 178 } … … 194 197 strcat(s, "\\"); 195 198 strcat(s, "USERDIRS.DAT"); 196 fp = fopen(s, "w");199 fp = xfopen(s, "w",pszSrcFile,__LINE__); 197 200 if (fp) 198 201 { … … 279 282 } 280 283 // Append entry to end of user dirs list 281 info = malloc(sizeof(LINKDIRS));284 info = xmalloc(sizeof(LINKDIRS),pszSrcFile,__LINE__); 282 285 if (info) 283 286 { 284 info -> path = strdup(path); 285 if (info -> path) 287 info -> path = xstrdup(path,pszSrcFile,__LINE__); 288 if (!info -> path) 289 free(info); 290 else 286 291 { 287 292 info -> next = NULL; … … 303 308 return TRUE; 304 309 } 305 else306 free(info);307 310 } 308 311 } … … 511 514 if (!mp2) 512 515 { 516 Runtime_Error(pszSrcFile, __LINE__, "no data"); 513 517 WinDismissDlg(hwnd, 0); 514 518 break; 515 519 } 516 wa = malloc(sizeof(WALKER));520 wa = xmallocz(sizeof(WALKER),pszSrcFile,__LINE__); 517 521 if (!wa) 518 522 { 519 DosBeep(50, 100);520 523 WinDismissDlg(hwnd, 0); 521 524 break; 522 525 } 523 memset(wa, 0, sizeof(WALKER));524 526 wa -> size = (USHORT) sizeof(WALKER); 525 527 WinSetWindowPtr(hwnd, 0, (PVOID) wa); … … 819 821 APIRET rc; 820 822 821 //*szBuffer = 0;822 // WinQueryDlgItemText(hwnd,WALK_RECENT,CCHMAXPATH,szBuffer);823 // *szBuffer = 0; 824 // WinQueryDlgItemText(hwnd,WALK_RECENT,CCHMAXPATH,szBuffer); 823 825 if (!*szBuffer) 824 826 break; … … 841 843 rc = 0; 842 844 } 843 if (!rc && (findbuf.attrFile & FILE_DIRECTORY)) 845 if (rc) 846 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,"DosFindFirst"); 847 else if (~findbuf.attrFile & FILE_DIRECTORY) 848 Runtime_Error(pszSrcFile, __LINE__, "not a directory"); 849 else 844 850 { 845 851 strcpy(wa -> szCurrentPath, szBuffer); … … 851 857 wa -> szCurrentPath, FALSE); 852 858 } 853 else854 DosBeep(50, 100);855 859 } 856 860 else if (SHORT2FROMMP(mp1) == CBN_ENTER) … … 892 896 rc = 0; 893 897 } 894 if (!rc && (findbuf.attrFile & FILE_DIRECTORY)) 898 if (rc) 899 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,"DosFindFirst"); 900 else if (~findbuf.attrFile & FILE_DIRECTORY) 901 Runtime_Error(pszSrcFile, __LINE__, "not a directory"); 902 else 895 903 { 896 904 strcpy(wa -> szCurrentPath, szBuffer); … … 901 909 wa -> szCurrentPath, FALSE); 902 910 } 903 else904 DosBeep(50, 100);905 911 } 906 912 else if (SHORT2FROMMP(mp1) == LN_ENTER) … … 1057 1063 { 1058 1064 MakeFullName(szBuff); 1059 if ( add_udir(TRUE,1060 szBuff)) 1061 {1065 if (!add_udir(TRUE, szBuff)) 1066 Runtime_Error(pszSrcFile, __LINE__, "add_udir"); 1067 else { 1062 1068 WinSendDlgItemMsg(hwnd, 1063 1069 WALK_USERLIST, … … 1067 1073 wa -> changed = 1; 1068 1074 } 1069 else1070 DosBeep(50, 100);1071 1075 } 1072 1076 break;
Note:
See TracChangeset
for help on using the changeset viewer.
