Changeset 1082

Show
Ignore:
Timestamp:
07/20/08 00:37:36 (6 weeks ago)
Author:
gyoung
Message:

Changes so FM2 will use TMP/TEMP directory for all temp files; Replaced save_dir2 with global variable so BldFullPathName? could easily replace code that performed the same function; Added #ifdef FORTIFY to free_ function that are only used when fortified.

Location:
trunk
Files:
22 modified

Legend:

Unmodified
Added
Removed
  • trunk/av2.c

    r907 r1082  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2007 Steven H. Levine 
     9  Copyright (c) 2007, 2008 Steven H. Levine 
    1010 
    1111  23 Sep 07 SHL Sync with standards 
  • trunk/databar.c

    r907 r1082  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2005 Steven H. Levine 
     9  Copyright (c) 2005, 2008 Steven H. Levine 
    1010 
    1111  Oct 15 21:42:56 2002 967 ______ databar.c 
  • trunk/dll/arccnrs.c

    r1078 r1082  
    5555  14 Jul 08 JBS Ticket 126: Add support for WPS open default & open settings in arccnrs 
    5656  16 Jul 08 GKY Fix trap on viewing multiple files from an archive (misplaced free) 
    57   16 JUL 08 GKY Use TMP directory for temp files if present. 
     57  16 Jul 08 GKY Use TMP directory for temp files if present. Use MakeTempName 
    5858 
    5959***********************************************************************/ 
     
    424424  HFILE newstdout; 
    425425  CHAR s[CCHMAXPATH * 2], lonename[CCHMAXPATH + 2], 
    426        *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[CCHMAXPATH]; 
     426       *nsize, *osize, *fdate, *fname, *p, *pp, *arctemp; 
    427427  BOOL gotstart; 
    428428  BOOL gotend; 
     
    442442  if (!info) 
    443443    info = find_type(arcname, NULL); 
    444   for (x = 0; x < 99; x++) { 
     444  arctemp = xmallocz(CCHMAXPATH, pszSrcFile, __LINE__); 
     445  MakeTempName(arctemp, ArcTempRoot, 2); 
     446  /*for (x = 0; x < 99; x++) { 
    445447    sprintf(arctemp, "%s.%03x", ArcTempRoot, (clock() & 4095L)); 
    446448    if (IsFile(arctemp) == 1) 
     
    448450    else 
    449451      break; 
    450   } 
     452  } */ 
     453 
     454  //printf("%s\r", arctemp); fflush(stdout); 
    451455 
    452456ReTry: 
     
    508512    else { 
    509513      fp = xfopen(arctemp, "w", pszSrcFile, __LINE__); 
    510       if (!fp) 
    511         return 0; 
     514      if (!fp) { 
     515        xfree(arctemp, pszSrcFile, __LINE__); 
     516        return 0; 
     517      } 
    512518      else { 
    513519        newstdout = -1; 
     
    516522        if (rc) { 
    517523          Dos_Error(MB_CANCEL, rc, hwndCnr, pszSrcFile, __LINE__, 
    518                     "DosDupHandle"); 
     524                    "DosDupHandle"); 
     525          xfree(arctemp, pszSrcFile, __LINE__); 
    519526          return 0; 
    520527        } 
     
    526533            Dos_Error(MB_CANCEL, rc, hwndCnr, pszSrcFile, __LINE__, 
    527534                      "DosDupHandle"); 
    528             return 0; 
     535            xfree(arctemp, pszSrcFile, __LINE__); 
     536            return 0; 
    529537          } 
    530538          else { 
     
    786794    DosError(FERR_DISABLEHARDERR); 
    787795    DosForceDelete(arctemp); 
     796    xfree(arctemp, pszSrcFile, __LINE__); 
    788797  } 
    789798 
     
    14841493        free(s); 
    14851494        if (IsFile(filename) == 1) { 
    1486 #if 0 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 
     1495#if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 
    14871496          if (fViewChild && fArcStuffVisible) 
    14881497            DosSleep(100);  // Allow unzip session to finish closing 14 Mar 07 SHL 
     
    17691778                if (p) { 
    17701779                  BldFullPathName(p, li->targetpath, temp); 
    1771                   /*strcpy(p, li->targetpath); 
    1772                   if (p[strlen(p) - 1] != '\\') 
    1773                     strcat(p, "\\"); 
    1774                   strcat(p, temp);*/ 
    17751780                  li->list[x] = p; 
    17761781                  free(temp); 
     
    35353540        dcd->id = id; 
    35363541        dcd->type = ARC_FRAME; 
    3537         if (!pTmpDir) { 
    3538           save_dir2(dcd->workdir); 
    3539           if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\') 
     3542        if (!pTmpDir) 
     3543          save_dir2(dcd->workdir); 
     3544        MakeTempName(dcd->workdir, ArcTempRoot, 2); 
     3545          /*if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\') 
    35403546            strcat(dcd->workdir, "\\"); 
    35413547          sprintf(dcd->workdir + strlen(dcd->workdir), "%s.%03x", 
    35423548                  ArcTempRoot, (clock() & 4095)); 
    3543         } 
    35443549        else 
    35453550          sprintf(dcd->workdir, "%s.%03x", 
    3546                   ArcTempRoot, (clock() & 4095)); 
     3551                  ArcTempRoot, (clock() & 4095));*/ 
    35473552        strcpy(dcd->arcname, fullname); 
    35483553        if (*extractpath) { 
  • trunk/dll/assoc.c

    r1039 r1082  
    1818  29 Feb 08 GKY Changes to enable user settable command line length 
    1919  29 Feb 08 GKY Use xfree where appropriate 
     20  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 
    2021 
    2122**************************************************************************************/ 
     
    142143    free_associations(); 
    143144  assloaded = TRUE; 
    144   save_dir2(mask); 
     145  BldFullPathName(mask, pFM2SaveDirectory, "ASSOC.DAT"); 
     146  /*save_dir2(mask); 
    145147  if (mask[strlen(mask) - 1] != '\\') 
    146148    strcat(mask, "\\"); 
    147   strcat(mask, "ASSOC.DAT"); 
     149  strcat(mask, "ASSOC.DAT");*/ 
    148150  fp = _fsopen(mask, "r", SH_DENYWR); 
    149151  pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 
     
    267269  } 
    268270#endif 
    269   save_dir2(s); 
     271  /*save_dir2(s); 
    270272  if (s[strlen(s) - 1] != '\\') 
    271273    strcat(s, "\\"); 
    272   strcat(s, "ASSOC.DAT"); 
     274    strcat(s, "ASSOC.DAT");*/ 
     275  BldFullPathName(s, pFM2SaveDirectory, "ASSOC.DAT"); 
    273276  fp = xfopen(s, "w", pszSrcFile, __LINE__); 
    274277  if (fp) { 
  • trunk/dll/avl.c

    r1039 r1082  
    3131  25 Aug 07 SHL load_archivers: add missing close on error path 
    3232  29 Feb 08 GKY Use xfree where appropriate 
    33   22 Jun 08 GKY Added free_archivers fot fortify checking 
     33  22 Jun 08 GKY Added free_archivers for fortify checking 
     34  19 Jul 08 GKY ifdef Fortify free_archivers 
    3435 
    3536***********************************************************************/ 
     
    218219} 
    219220 
     221# ifdef FORTIFY 
     222 
    220223VOID free_archivers(VOID) 
    221224{ 
     
    247250 
    248251//=== free_arc_type() free allocated ARC_TYPE === 
     252 
     253# endif 
    249254 
    250255VOID free_arc_type(ARC_TYPE * pat) 
  • trunk/dll/cmdline.c

    r1039 r1082  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2004, 2007 Steven H.Levine 
     9  Copyright (c) 2004, 2008 Steven H.Levine 
    1010 
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage 
     
    1818  29 Feb 08 GKY Use xfree where appropriate 
    1919  20 Apr 08 GKY New variable names; Save and Load command lines of user set length 
     20  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 
    2021 
    2122***********************************************************************/ 
     
    7475    else 
    7576      MiniLoaded = TRUE; 
    76     save_dir2(pszCmdLine); 
     77    BldFullPathName(pszCmdLine, pFM2SaveDirectory, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 
     78    /*save_dir2(pszCmdLine); 
    7779    if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 
    7880      strcat(pszCmdLine, "\\"); 
    79     strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 
     81    strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT");*/ 
    8082    fp = _fsopen(pszCmdLine, "r", SH_DENYWR); 
    8183    if (fp) { 
     
    130132  if (!pszCmdLine) 
    131133    return; 
    132   save_dir2(pszCmdLine); 
     134  BldFullPathName(pszCmdLine, pFM2SaveDirectory, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 
     135  /*save_dir2(pszCmdLine); 
    133136  if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 
    134137    strcat(pszCmdLine, "\\"); 
    135   strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 
     138  strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT");*/ 
    136139  if (CmdLineHead) { 
    137140    fp = xfopen(pszCmdLine, "w", pszSrcFile, __LINE__); 
  • trunk/dll/command.c

    r1078 r1082  
    2525  29 Feb 08 GKY Use xfree where appropriate 
    2626  18 Jul 08 SHL Add Fortify support 
     27  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 
    2728 
    2829***********************************************************************/ 
     
    331332  pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 
    332333  if (pszCmdLine) { 
    333     save_dir2(pszCmdLine); 
     334    BldFullPathName(pszCmdLine, pFM2SaveDirectory, "COMMANDS.DAT"); 
     335    /*save_dir2(pszCmdLine); 
    334336    if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 
    335337      strcat(pszCmdLine, "\\"); 
    336     strcat(pszCmdLine, "COMMANDS.DAT"); 
     338    strcat(pszCmdLine, "COMMANDS.DAT");*/ 
    337339    fp = _fsopen(pszCmdLine, "r", SH_DENYWR); 
    338340    if (fp) { 
     
    399401    return; 
    400402  info = cmdhead; 
    401   save_dir2(s); 
     403  BldFullPathName(s, pFM2SaveDirectory, "COMMANDS.DAT"); 
     404  /*save_dir2(s); 
    402405  if (s[strlen(s) - 1] != '\\') 
    403406    strcat(s, "\\"); 
    404   strcat(s, "COMMANDS.DAT"); 
     407  strcat(s, "COMMANDS.DAT");*/ 
    405408  fp = xfopen(s, "w", pszSrcFile, __LINE__); 
    406409  if (fp) { 
  • trunk/dll/copyf.c

    r1039 r1082  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2001, 2006 Steven H.Levine 
     9  Copyright (c) 2001, 2008 Steven H.Levine 
    1010 
    1111  14 Sep 02 SHL Drop obsolete debug code 
     
    1919  01 Sep 07 GKY Use xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundry 
    2020  29 Feb 08 GKY Use xfree where appropriate 
     21  19 Jul 08 GKY Modify MakeTempName for use making temp directory names 
    2122 
    2223***********************************************************************/ 
     
    4950#endif 
    5051 
    51 char *MakeTempName(char *buffer) 
     52char *MakeTempName(char *buffer, char *temproot, INT type) 
    5253{ 
    5354  FILESTATUS3 fs3; 
     
    5556  char *p, *o; 
    5657 
     58  if (strlen(buffer) > 3 && buffer[strlen(buffer) - 1] != '\\') 
     59    strcat(buffer, "\\"); 
    5760  p = o = buffer + strlen(buffer); 
    58   sprintf(p, "%08lx.%03lx", clock(), mypid); 
     61  switch (type) { 
     62  case 0: 
     63    sprintf(p, "%08lx.%03lx", rand() & 4095L, mypid); 
     64    break; 
     65  case 1: 
     66    sprintf(p, "%s%04lx.%03lx", "$FM2", rand() & 4095L, mypid); 
     67    break; 
     68  case 2: 
     69    sprintf(p, "%s.%03x", temproot, (rand() & 4095)); 
     70    break; 
     71  default: 
     72    break; 
     73  } 
    5974  p = buffer + (strlen(buffer) - 1); 
    6075  for (;;) { 
     
    510525          *p = 0; 
    511526        strcat(dir, "\\"); 
    512         MakeTempName(dir); 
     527        MakeTempName(dir, NULL, 0); 
    513528        if (DosMove(fullnewname, dir)) 
    514529          *dir = 0; 
     
    894909#pragma alloc_text(LONGNAMES,TruncName,GetLongName,WriteLongName) 
    895910#pragma alloc_text(LONGNAMES,ZapLongName,AdjustWildcardName) 
    896 #pragma alloc_text(COPYF,default_disk,docopyf) 
     911#pragma alloc_text(COPYF,default_disk,docopyf,MakeTempName) 
    897912#pragma alloc_text(UNLINKF,unlinkf,unlink_allf,make_deleteable,wipeallf) 
  • trunk/dll/dircnrs.c

    r1079 r1082  
    7070#include "command.h"                    // RunCommand 
    7171#include "fm3dll.h" 
    72 #include "avl.h"                        // free_archivers 
     72//#include "avl.h"                      // free_archivers 
    7373#ifdef FORTIFY 
    7474#include "misc.h"                       // GetTidForThread 
  • trunk/dll/dirsize.c

    r1067 r1082  
    77 
    88  Copyright (c) 1993-98 M. Kimes 
    9   Copyright (c) 2001, 2007 Steven H. Levine 
     9  Copyright (c) 2001, 2008 Steven H. Levine 
    1010 
    1111  16 Oct 02 SHL Handle large partitions 
     
    3434  29 Feb 08 GKY Add presparams & update appearence of "Sizes" dialog 
    3535  07 Jul 08 GKY Fixed trap in PMCTLS (strlen) inadequate memory allocation 
    36   07 Jul o8 GKY Fixed trap by no longer allocating pci->pszLongName as flag but pointing isroot 
     36  07 Jul 08 GKY Fixed trap by no longer allocating pci->pszLongName as flag but pointing isroot 
    3737                version to NullStr and all others to NULL. 
     38  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory; use pTmpDir for temp files 
    3839 
    3940***********************************************************************/ 
     
    927928        FILE *fp; 
    928929 
    929         save_dir2(szFileName); 
     930        if (pTmpDir) 
     931          strcpy(szFileName, pTmpDir); 
     932        else 
     933          strcpy(szFileName, pFM2SaveDirectory); 
     934        //save_dir2(szFileName); 
    930935        sprintf(&szFileName[strlen(szFileName)], "\\%csizes.Rpt", 
    931936                (pState) ? toupper(*pState->szDirName) : '+'); 
  • trunk/dll/filter.c

    r1039 r1082  
    1515  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 
    1616  29 Feb 08 GKY Use xfree where appropriate 
     17  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 
    1718 
    1819***********************************************************************/ 
     
    3031#include "errutil.h"                    // Dos_Error... 
    3132#include "strutil.h"                    // GetPString 
     33#include "pathutil.h"                   // BldFullPathName 
    3234#include "fm3dll.h" 
    3335#include "fortify.h" 
     
    133135 
    134136  loadedmasks = TRUE; 
    135   save_dir2(s); 
     137  BldFullPathName(s, pFM2SaveDirectory, "FILTER.DAT"); 
     138  /*save_dir2(s); 
    136139  if (s[strlen(s) - 1] != '\\') 
    137140    strcat(s, "\\"); 
    138   strcat(s, "FILTERS.DAT"); 
     141  strcat(s, "FILTERS.DAT");*/ 
    139142  fp = _fsopen(s, "r", SH_DENYWR); 
    140143  if (fp) { 
     
    175178    return; 
    176179  if (maskhead) { 
    177     save_dir2(s); 
     180    BldFullPathName(s, pFM2SaveDirectory, "FILTER.DAT"); 
     181    /*save_dir2(s); 
    178182    if (s[strlen(s) - 1] != '\\') 
    179183      strcat(s, "\\"); 
    180     strcat(s, "FILTERS.DAT"); 
     184    strcat(s, "FILTERS.DAT");*/ 
    181185    fp = xfopen(s, "w", pszSrcFile, __LINE__); 
    182186    if (fp) { 
  • trunk/dll/fm3dll.h

    r1076 r1082  
    8484                DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 
    8585  16 JUL 08 GKY Use TMP directory for temp files 
     86  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use MakeTempName; Remove LISTTEMPROOT 
    8687 
    8788***********************************************************************/ 
     
    229230#define ALLATTRS                (FILE_NORMAL | FILE_DIRECTORY | FILE_ARCHIVED |\ 
    230231                                 FILE_HIDDEN | FILE_READONLY | FILE_SYSTEM) 
    231 #define LISTTEMPROOT            "$FM2LI$T." 
     232//#define LISTTEMPROOT            "$FM2LI$T" 
    232233 
    233234#include "fm3dll2.h" 
     
    630631CHAR default_disk(VOID); 
    631632APIRET docopyf(INT type, CHAR * oldname, CHAR * newname, ...); 
     633char *MakeTempName(char *buffer, char *temproot, int type); 
    632634 
    633635#define COPY 0 
     
    11111113             hwndLED, hwndLEDHdr, hwndAutoMLE, hwndCmdlist; 
    11121114DATADEF HBITMAP hbmLEDon, hbmLEDoff; 
    1113 DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir; 
     1115DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir, *pFM2SaveDirectory; 
    11141116DATADEF HPOINTER hptrArrow, hptrBusy, hptrLast, hptrDir, hptrFile, hptrRemote, 
    11151117  hptrFloppy, hptrDrive, hptrRemovable, hptrCDROM,hptrVirtual,hptrRamdisk, 
  • trunk/dll/grep2.c

    r1063 r1082  
    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  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 
    2223 
    2324  fixme for more excess locals to be gone 
     
    4243#include "errutil.h"                    // Dos_Error... 
    4344#include "strutil.h"                    // GetPString 
     45#include "pathutil.h"                   // BldFullPathName 
    4446#include "fm3dll.h" 
    4547#include "fortify.h" 
     
    268270    WinEnableWindow(WinWindowFromID(hwnd, GREP_NOSIZEDUPES), FALSE); 
    269271 
    270     save_dir2(s); 
     272    BldFullPathName(s, pFM2SaveDirectory, "GREPMASK.DAT"); 
     273    /*save_dir2(s); 
    271274    if (s[strlen(s) - 1] != '\\') 
    272275      strcat(s, "\\"); 
    273     strcat(s, "GREPMASK.DAT"); 
     276    strcat(s, "GREPMASK.DAT");*/ 
    274277    fp = _fsopen(s, "r", SH_DENYWR); 
    275278    if (fp) { 
     
    947950                                            LM_QUERYITEMCOUNT, 
    948951                                            MPVOID, MPVOID); 
    949         if (sSelect > 0) { 
    950           save_dir2(s); 
     952        if (sSelect > 0) { 
     953          BldFullPathName(s, pFM2SaveDirectory, "GREPMASK.DAT"); 
     954          /*save_dir2(s); 
    951955          if (s[strlen(s) - 1] != '\\') 
    952956            strcat(s, "\\"); 
    953           strcat(s, "GREPMASK.DAT"); 
     957          strcat(s, "GREPMASK.DAT");*/ 
    954958          fp = xfopen(s, "w", pszSrcFile, __LINE__); 
    955959          if (fp) { 
  • trunk/dll/inis.c

    r1063 r1082  
    2626  09 Jan 08 SHL Use CloseProfile to avoid spurious system INI closes 
    2727  29 Feb 08 GKY Use xfree where appropriate 
     28  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory or pTmpDir and use BldFullPathName 
    2829 
    2930***********************************************************************/ 
     
    4647#include "errutil.h"                    // Dos_Error... 
    4748#include "strutil.h"                    // GetPString 
     49#include "pathutil.h"                   // BldFullPathName 
    4850#include "fm3dll.h" 
    4951#include "fortify.h" 
     
    11341136        /* make copies of new inis */ 
    11351137        *tempuserini = 0; 
    1136         *tempsysini = 0; 
    1137         save_dir2(tempuserini); 
     1138        *tempsysini = 0; 
     1139        BldFullPathName(tempuserini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPUSER.INI"); 
     1140        /*save_dir2(tempuserini); 
    11381141        if (tempuserini[strlen(tempuserini) - 1] != '\\') 
    11391142          strcat(tempuserini, "\\"); 
    1140         strcat(tempuserini, "TEMPUSER.INI"); 
     1143        strcat(tempuserini, "TEMPUSER.INI");*/ 
    11411144        rc = DosCopy(userini, tempuserini, DCPY_EXISTING); 
    11421145        if (rc) { 
     
    11481151                    GetPString(IDS_COMPCOPYFAILEDTEXT), userini, tempuserini); 
    11491152          break; 
    1150         } 
    1151         save_dir2(tempsysini); 
     1153        } 
     1154        BldFullPathName(tempsysini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPSYS.INI"); 
     1155        /*save_dir2(tempsysini); 
    11521156        if (tempsysini[strlen(tempsysini) - 1] != '\\') 
    11531157          strcat(tempsysini, "\\"); 
    1154         strcat(tempsysini, "TEMPSYS.INI"); 
     1158        strcat(tempsysini, "TEMPSYS.INI");*/ 
    11551159        rc = DosCopy(sysini, tempsysini, DCPY_EXISTING); 
    11561160        if (rc) { 
  • trunk/dll/init.c

    r1077 r1082  
    5151  16 JUL 08 GKY Use TMP directory for temp files 
    5252  17 Jul 08 SHL Reduce code bulk in fUseTmp setup 
     53  19 Jul 08 GKY Use pFM2SaveDirectory, MakeTempName and move temp files to TMP subdirectory if (TMP). 
    5354 
    5455***********************************************************************/ 
     
    514515    } 
    515516  } 
    516  
    517   save_dir(s); 
     517  if (pTmpDir) 
     518    strcpy(s, pTmpDir); 
     519  else 
     520    save_dir2(s); 
    518521  if (s[strlen(s) - 1] != '\\') 
    519522    strcat(s, "\\"); 
    520523  enddir = &s[strlen(s)]; 
    521   strcat(s, LISTTEMPROOT); 
     524  strcat(s, "$FM2LI$T"); 
    522525  strcat(s, "???"); 
    523526  search_handle = HDIR_CREATE; 
     
    541544  BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 
    542545  DosForceDelete(szTempFile); 
     546  if (pTmpDir) { 
     547    wipeallf("%s\\*", pTmpDir); 
     548    DosDeleteDir(pTmpDir); 
     549  } 
    543550  EndNote(); 
    544551  if (FM3ModHandle) 
     
    650657  } 
    651658 
    652   /* set up default root names for temp archive goodies */ 
     659  // set up default root names for temp file storage and archive goodies 
    653660  env = getenv("TMP"); 
    654661  if (env == NULL) 
     
    659666    if (!rc) { 
    660667      if (fs3.attrFile & FILE_DIRECTORY) { 
    661         // 17 Jul 08 SHL fixme to check writable someday 
    662<