Changeset 1073 for trunk/dll/undel.c


Ignore:
Timestamp:
Jul 18, 2008, 2:30:20 AM (17 years ago)
Author:
Gregg Young
Message:

Fm2 uses TMP/TEMP directory if set for temporary files and directories. Ticket 20

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/undel.c

    r1063 r1073  
    3131#include "errutil.h"                    // Dos_Error...
    3232#include "strutil.h"                    // GetPString
     33#include "pathutil.h"                   // BldFullPathName
    3334#include "fm3dll.h"
    3435#include "fortify.h"
     
    4849{
    4950  HWND hwnd;
    50   CHAR s[CCHMAXPATH * 2];
     51  CHAR s[CCHMAXPATH * 2], szTempFile[CCHMAXPATH];
    5152  CHAR *path;
    5253  HAB thab;
     
    7273    IncrThreadUsage();
    7374    WinSendDlgItemMsg(hwnd, UNDEL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID);
    74     unlinkf("%s", "$UDELETE.#$#");
    75     fp = xfopen("$UDELETE.#$#", "w", pszSrcFile, __LINE__);
     75    if (fUseTmp)
     76      BldFullPathName(szTempFile, pTmpDir, "$UDELETE.#$#");
     77    else
     78      strcpy(szTempFile, "$UDELETE.#$#");
     79    unlinkf("%s", szTempFile);
     80    fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__);
    7681    if (!fp) {
    7782      Win_Error(NULLHANDLE, hwnd, pszSrcFile, __LINE__,
     
    103108      fclose(fp);
    104109    }
    105     fp = xfopen("$UDELETE.#$#", "r", pszSrcFile, __LINE__);
     110    fp = xfopen(szTempFile, "r", pszSrcFile, __LINE__);
    106111    if (fp) {
    107112      xfgets(s, sizeof(s), fp, pszSrcFile, __LINE__);   // Skip 1st line
     
    150155    ;
    151156  }
    152   DosForceDelete("$UDELETE.#$#");
     157  DosForceDelete(szTempFile);
    153158  xfree(undelinfo, pszSrcFile, __LINE__);
    154159  if (thmq) {
Note: See TracChangeset for help on using the changeset viewer.