Changeset 1720


Ignore:
Timestamp:
Feb 16, 2014, 8:47:30 PM (12 years ago)
Author:
Gregg Young
Message:

Add "#" command line switch to workaround problem with blank command shell started from fm2 after fm2 has been started with stdout and stderr redirected to a file. Fixes it by using the system environment instead of fm2's when starting command shells.

Location:
trunk/dll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r1713 r1720  
    117117  09 Feb 14 GKY Modified wipeallf to allow suppression of the readonly warning on delete
    118118                of temporary files
     119  16 Feb 14 GKY Add "#" command line switch to workaround problem with blank command shell
     120                started from fm2 after fm2 has been started with stdout and stderr
     121                redirected to a file.
    119122
    120123***********************************************************************/
     
    235238BOOL fReminimize;
    236239BOOL fWantFirstTimeInit;
     240BOOL fUseShellEnv;
    237241//BOOL fDrivetoSkip[26];
    238242HPOINTER hptrApp;
     
    11591163    fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives = fDataMin =
    11601164    fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine =
    1161     fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree = fWarnReadOnly =
     1165    fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =
    11621166    fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp =
    11631167    fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
     
    16841688        strcpy(profile, &argv[x][1]);
    16851689    }
     1690    if (*argv[x] == '#' && !argv[x][1])
     1691      fUseShellEnv = TRUE;
    16861692  }
    16871693
  • trunk/dll/init.h

    r1673 r1720  
    3333  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
    3434                for delete of readonly files
     35  16 Feb 14 GKY Add "#" command line switch to workaround problem with blank command shell
     36                started from fm2 after fm2 has been started with stdout and stderr
     37                redirected to a file.
    3538
    3639***********************************************************************/
     
    203206extern BOOL fReminimize;
    204207extern BOOL fWantFirstTimeInit;
     208extern BOOL fUseShellEnv;
    205209extern HPOINTER hptrApp;
    206210extern HPOINTER hptrArc;
  • trunk/dll/systemf.c

    r1673 r1720  
    3939  26 Aug 11 GKY Add a low mem version of xDosAlloc* wrappers; move error checking into all the
    4040                xDosAlloc* wrappers.
     41  16 Feb 14 GKY Add "#" command line switch to workaround problem with blank command shell
     42                started from fm2 after fm2 has been started with stdout and stderr
     43                redirected to a file.
    4144
    4245***********************************************************************/
     
    11901193      }
    11911194      sdata.Environment = (PBYTE)pszEnvironment;
    1192       sdata.InheritOpt = SSF_INHERTOPT_PARENT;
     1195      if (fUseShellEnv && (!strcmp(GetCmdSpec(TRUE), pszPgm) ||
     1196          !strcmp(GetCmdSpec(FALSE), pszPgm)))
     1197        sdata.InheritOpt = SSF_INHERTOPT_SHELL;
     1198      else
     1199        sdata.InheritOpt = SSF_INHERTOPT_PARENT;
    11931200      sdata.SessionType = (USHORT) ulAppType;
    11941201      sdata.ObjectBuffer = szObject;
Note: See TracChangeset for help on using the changeset viewer.