Changeset 985 for trunk/dll/systemf.c


Ignore:
Timestamp:
Mar 1, 2008, 2:37:14 AM (17 years ago)
Author:
Gregg Young
Message:

Update sizes dialog (ticket 44); Make max command line length user settable (ticket 199); use xfree for free in most cases (ticket 212); initial code to check for valid ini file (ticket 102); Some additional refactoring and structure rework; Some documentation updates;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r920 r985  
    2020  06 Aug 07 GKY Reduce DosSleep times (ticket 148)
    2121  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
    2225
    2326***********************************************************************/
     
    3740#include "errutil.h"                    // Dos_Error...
    3841#include "strutil.h"                    // GetPString
     42#include "notebook.h"                   //targetdirectory
    3943#include "pathutil.h"
    4044#include "fm3dll.h"
     
    8084  /* executes the command once for all files in list */
    8185
    82   char path[CCHMAXPATH], commandline[MAXCOMLINESTRG], modpath[CCHMAXPATH], listfile[CCHMAXPATH],
     86  char path[CCHMAXPATH], *commandline, modpath[CCHMAXPATH], listfile[CCHMAXPATH],
    8387       *p, *pp, drive, *file, *ext, *dot;
    8488  register int x;
     
    8993    return -1;
    9094  }
     95  commandline = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
     96  if (!commandline)
     97    return -1; //already complained
    9198  *listfile = 0;
    9299  bstrip(command);
     
    590597      ret = WinDlgBox(HWND_DESKTOP, hwnd, CmdLineDlgProc, FM3ModHandle,
    591598                      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      }
    594603    }
    595604    else
     
    673682
    674683  rc = DosAllocMem((PVOID)&pszPgm,
    675                    MAXCOMLINESTRG,
     684                   MaxComLineStrg,
    676685                   PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
    677686  if (rc) {
     
    718727      if (temp) {
    719728        rc = DosAllocMem((PVOID)&pszArgs,
    720                          MAXCOMLINESTRG * 2,
     729                         MaxComLineStrg * 2,
    721730                         PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
    722731        if (rc)
     
    851860      if (~type & FULLSCREEN)
    852861        type |= WINDOWED;
    853       rc = DosAllocMem((PVOID) & pszArgs, MAXCOMLINESTRG * 2,
     862      rc = DosAllocMem((PVOID) & pszArgs, MaxComLineStrg * 2,
    854863                       PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
    855864      if (rc) {
     
    12341243    ulOptions |= SAF_STARTCHILDAPP;
    12351244
    1236   executable = xmallocz(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     1245  executable = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
    12371246  if (executable) {
    12381247    va_start(parguments, formatstring);
     
    12411250    strip_lead_char(" \t", executable);
    12421251    if (*executable) {
    1243       parameters = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     1252      parameters = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    12441253      if (parameters) {
    12451254        p = executable;
     
    12931302              strcpy(executable, GetCmdSpec(FALSE));
    12941303            }
    1295             free(temp);
     1304            xfree(temp);
    12961305          }
    12971306        }
     
    13071316        pgd.swpInitial.hwndInsertBehind = HWND_TOP;
    13081317        happ = WinStartApp(hwndNotify, &pgd, NULL, NULL, ulOptions);
    1309         free(parameters);
     1318        xfree(parameters);
    13101319      }
    13111320    }
    1312     free(executable);
     1321    xfree(executable);
    13131322  }
    13141323  return happ;
Note: See TracChangeset for help on using the changeset viewer.