Changeset 989 for trunk/dll/misc.c


Ignore:
Timestamp:
Mar 2, 2008, 12:34:12 AM (17 years ago)
Author:
Gregg Young
Message:

Refactor fm3dll.h to create command.h; broken ini is now replaced with backup or new ini as available; more variable command line ledth changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/misc.c

    r985 r989  
    5757#include "fm3dlg.h"
    5858#include "fm3str.h"
    59 #include "pathutil.h"              // BldQuotedFileName
     59#include "pathutil.h"               // BldQuotedFileName
    6060#include "errutil.h"                // Dos_Error...
    6161#include "strutil.h"                // GetPString
     62#include "command.h"                // LINKCMDS
    6263#include "fm3dll.h"
    6364
     
    962963{
    963964  EXECARGS ex;
    964   CHAR cl[1001], path[CCHMAXPATH], *p;
     965  CHAR path[CCHMAXPATH], *p;
     966  PSZ pszCmdLine;
    965967  APIRET ret;
    966968  static INT lastflags = 0;
     
    980982  else
    981983    *path = 0;
    982   *cl = 0;
    983   BldQuotedFileName(cl, filename);
    984   memset(&ex, 0, sizeof(ex));
    985   ex.flags = lastflags;
    986   ex.commandline = cl;
    987   *ex.path = 0;
    988   *ex.environment = 0;
    989   ret = WinDlgBox(HWND_DESKTOP, hwnd, CmdLineDlgProc, FM3ModHandle,
    990                   EXEC_FRAME, &ex);
    991   if (ret == 1) {
    992     lastflags = ex.flags;
    993     return runemf2(ex.flags, hwnd, pszSrcFile, __LINE__, path,
    994                    *ex.environment ? ex.environment : NULL,
    995                    "%s", cl) != -1;
    996   }
    997   else if (ret != 0)
    998     return -1;
     984  pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
     985  if (pszCmdLine) {
     986    BldQuotedFileName(pszCmdLine, filename);
     987    memset(&ex, 0, sizeof(ex));
     988    ex.flags = lastflags;
     989    ex.commandline = pszCmdLine;
     990    *ex.path = 0;
     991    *ex.environment = 0;
     992    ret = WinDlgBox(HWND_DESKTOP, hwnd, CmdLineDlgProc, FM3ModHandle,
     993                    EXEC_FRAME, &ex);
     994    if (ret == 1) {
     995      lastflags = ex.flags;
     996      return runemf2(ex.flags, hwnd, pszSrcFile, __LINE__, path,
     997                     *ex.environment ? ex.environment : NULL,
     998                     "%s", pszCmdLine) != -1;
     999    }
     1000    else if (ret != 0)
     1001      return -1;
     1002    xfree(pszCmdLine);
     1003  }
    9991004  return 0;
    10001005}
Note: See TracChangeset for help on using the changeset viewer.