Changeset 985 for trunk/dll/systemf.c
- Timestamp:
- Mar 1, 2008, 2:37:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/systemf.c
r920 r985 20 20 06 Aug 07 GKY Reduce DosSleep times (ticket 148) 21 21 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 22 29 Feb 08 GKY Use xfree where appropriate 23 29 Feb 08 GKY Changes to enable user settable command line length 24 29 Feb 08 GKY Refactor global command line variables to notebook.h 22 25 23 26 ***********************************************************************/ … … 37 40 #include "errutil.h" // Dos_Error... 38 41 #include "strutil.h" // GetPString 42 #include "notebook.h" //targetdirectory 39 43 #include "pathutil.h" 40 44 #include "fm3dll.h" … … 80 84 /* executes the command once for all files in list */ 81 85 82 char path[CCHMAXPATH], commandline[MAXCOMLINESTRG], modpath[CCHMAXPATH], listfile[CCHMAXPATH],86 char path[CCHMAXPATH], *commandline, modpath[CCHMAXPATH], listfile[CCHMAXPATH], 83 87 *p, *pp, drive, *file, *ext, *dot; 84 88 register int x; … … 89 93 return -1; 90 94 } 95 commandline = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 96 if (!commandline) 97 return -1; //already complained 91 98 *listfile = 0; 92 99 bstrip(command); … … 590 597 ret = WinDlgBox(HWND_DESKTOP, hwnd, CmdLineDlgProc, FM3ModHandle, 591 598 EXEC_FRAME, &ex); 592 if (ret != 1) 593 return (ret == 0) ? -1 : -2; 599 if (ret != 1) { 600 xfree(commandline); 601 return (ret == 0) ? -1 : -2; 602 } 594 603 } 595 604 else … … 673 682 674 683 rc = DosAllocMem((PVOID)&pszPgm, 675 M AXCOMLINESTRG,684 MaxComLineStrg, 676 685 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 677 686 if (rc) { … … 718 727 if (temp) { 719 728 rc = DosAllocMem((PVOID)&pszArgs, 720 M AXCOMLINESTRG* 2,729 MaxComLineStrg * 2, 721 730 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 722 731 if (rc) … … 851 860 if (~type & FULLSCREEN) 852 861 type |= WINDOWED; 853 rc = DosAllocMem((PVOID) & pszArgs, M AXCOMLINESTRG* 2,862 rc = DosAllocMem((PVOID) & pszArgs, MaxComLineStrg * 2, 854 863 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 855 864 if (rc) { … … 1234 1243 ulOptions |= SAF_STARTCHILDAPP; 1235 1244 1236 executable = xmallocz(M AXCOMLINESTRG, pszSrcFile, __LINE__);1245 executable = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 1237 1246 if (executable) { 1238 1247 va_start(parguments, formatstring); … … 1241 1250 strip_lead_char(" \t", executable); 1242 1251 if (*executable) { 1243 parameters = xmalloc(M AXCOMLINESTRG, pszSrcFile, __LINE__);1252 parameters = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 1244 1253 if (parameters) { 1245 1254 p = executable; … … 1293 1302 strcpy(executable, GetCmdSpec(FALSE)); 1294 1303 } 1295 free(temp);1304 xfree(temp); 1296 1305 } 1297 1306 } … … 1307 1316 pgd.swpInitial.hwndInsertBehind = HWND_TOP; 1308 1317 happ = WinStartApp(hwndNotify, &pgd, NULL, NULL, ulOptions); 1309 free(parameters);1318 xfree(parameters); 1310 1319 } 1311 1320 } 1312 free(executable);1321 xfree(executable); 1313 1322 } 1314 1323 return happ;
Note:
See TracChangeset
for help on using the changeset viewer.