Changeset 328 for trunk/dll/viewer.c
- Timestamp:
- Jul 25, 2006, 8:37:24 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/viewer.c
r186 r328 7 7 8 8 Copyright (c) 1993-97 M. Kimes 9 Copyright (c) 2005 Steven H. Levine9 Copyright (c) 2005, 2006 Steven H. Levine 10 10 11 11 23 May 05 SHL Use QWL_USER 12 17 Jul 06 SHL Use Runtime_Error 12 13 13 14 ***********************************************************************/ … … 15 16 #define INCL_DOS 16 17 #define INCL_WIN 17 18 18 #include <os2.h> 19 19 20 #include <stdlib.h> 20 21 #include <stdio.h> … … 22 23 #include <time.h> 23 24 #include <io.h> 25 24 26 #include "fm3dll.h" 25 27 #include "fm3dlg.h" … … 28 30 29 31 #pragma data_seg(DATA1) 32 33 static PSZ pszSrcFile = __FILE__; 34 30 35 #pragma alloc_text(VIEWER,MLEEditorProc,MLESubProc) 31 36 #pragma alloc_text(STARTUP,StartMLEEditor) … … 66 71 return StartViewer(hwndClient,(USHORT)flags,filename,hwndRestore); 67 72 68 vw = malloc(sizeof(XMLEWNDPTR)); 69 if(!vw) { 70 DosBeep(50,100); 73 vw = xmallocz(sizeof(XMLEWNDPTR),pszSrcFile,__LINE__); 74 if(!vw) 71 75 return (HWND)0; 72 }73 memset(vw,0,sizeof(XMLEWNDPTR));74 76 vw->size = sizeof(XMLEWNDPTR); 75 77 if(flags & 1) { … … 758 760 } 759 761 switch(SHORT1FROMMP(mp1)) { 760 /*762 /* 761 763 case MLE_PREVIEW: 762 764 preview_text(hwndMLE); 763 765 break; 764 */766 */ 765 767 case MLE_VIEWFTP: 766 768 MLEinternet(hwndMLE,TRUE); … … 871 873 872 874 case MLE_TOGGLEREADONLY: 873 if(!vw->busy && vw->hex != 1) { /* I dunno why I gotta reset the colors... */ 874 875 if (vw->busy || vw->hex == 1) { 876 DosBeep(50,100); 877 } 878 else { 879 /* I dunno why I gotta reset the colors... */ 875 880 BOOL ro; 876 881 LONG fColor,bColor; … … 914 919 MPVOID); 915 920 } 916 else917 DosBeep(50,100);918 921 break; 919 922 … … 953 956 break; 954 957 } 955 { /* zero file length instead of unlink (protects EAs from loss) */ 958 { 959 /* zero file length instead of unlink (protects EAs from loss) */ 956 960 FILE *fp; 957 961 958 fp = fopen(vw->exportfilename,"r+");959 if (fp) {962 fp = xfopen(vw->exportfilename,"r+",pszSrcFile,__LINE__); 963 if (fp) { 960 964 oldsize = filelength(fileno(fp)); 961 965 DosSetFileSize(fileno(fp),0L); … … 963 967 } 964 968 } 965 if (!MLEexportfile(hwndMLE,969 if (!MLEexportfile(hwndMLE, 966 970 vw->exportfilename, 967 971 vw->ExpandTabs, … … 969 973 vw->fStripTrail)) { 970 974 FILE *fp; 971 972 DosBeep(50,100); 973 fp = fopen(vw->exportfilename,"r+"); 974 if(fp) { 975 Runtime_Error(pszSrcFile, __LINE__, "MLEexportfile"); 976 fp = xfopen(vw->exportfilename,"r+",pszSrcFile,__LINE__); 977 if (fp) { 975 978 DosSetFileSize(fileno(fp),oldsize); 976 979 fclose(fp); … … 1191 1194 sip.title = GetPString(IDS_NVLINEJUMPTITLETEXT); 1192 1195 numlines = MLEnumlines(hwndMLE); 1193 if(numlines) { 1196 if(!numlines) 1197 DosBeep(50,100); 1198 else { 1194 1199 sprintf(sip.prompt, 1195 1200 GetPString(IDS_NVJUMPTEXT), … … 1203 1208 STR_FRAME, 1204 1209 &sip); 1205 if (*s) {1210 if (*s) { 1206 1211 linenum = atol(s); 1207 if (linenum > 0 && linenum <= numlines) {1212 if (linenum > 0 && linenum <= numlines) { 1208 1213 MLEsettopline(hwndMLE, 1209 1214 MLEstartofline(hwndMLE, … … 1215 1220 } 1216 1221 } 1217 else1218 DosBeep(50,100);1219 1222 } 1220 1223 break;
Note:
See TracChangeset
for help on using the changeset viewer.