Changeset 1082 for trunk/dll/systemf.c


Ignore:
Timestamp:
Jul 20, 2008, 12:37:36 AM (17 years ago)
Author:
Gregg Young
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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1047 r1082  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2003, 2006 Steven H.Levine
     9  Copyright (c) 2003, 2008 Steven H.Levine
    1010
    1111  21 Nov 03 SHL Comments
     
    2323  29 Feb 08 GKY Refactor global command line variables to notebook.h
    2424  26 May 08 SHL Use uiLineNumber correctly
     25  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory or pTmpDir and use MakeTempName
    2526
    2627***********************************************************************/
     
    181182            FILE *fp;
    182183
    183             save_dir2(listfile);
    184             if (listfile[strlen(listfile) - 1] != '\\')
    185               strcat(listfile, "\\");
    186             sprintf(&listfile[strlen(listfile)], "%s%03x",
    187                     LISTTEMPROOT, (clock() & 4095));
    188             fp = xfopen(listfile, "w",pszSrcFile,__LINE__);
    189             if (fp) {
    190               for (x = 0; list[x]; x++)
    191               {
    192                 fputs(list[x], fp);
    193                 if (list[x + 1])
    194                   fputc('\n', fp);
    195               }
    196               fclose(fp);
    197             }
    198           }
    199           strcpy(pp, listfile);
    200           pp += strlen(listfile);
     184
     185            strcpy(listfile, pTmpDir ? pTmpDir : pFM2SaveDirectory);
     186            MakeTempName(listfile, "$FM2LI$T", 2);
     187            /*if (listfile[strlen(listfile) - 1] != '\\')
     188              strcat(listfile, "\\");
     189            sprintf(&listfile[strlen(listfile)], "%s.%03x",
     190                    LISTTEMPROOT, (clock() & 4095));*/
     191            fp = xfopen(listfile, "w",pszSrcFile,__LINE__);
     192            if (fp) {
     193              for (x = 0; list[x]; x++)
     194              {
     195                fputs(list[x], fp);
     196                if (list[x + 1])
     197                  fputc('\n', fp);
     198              }
     199              fclose(fp);
     200            }
     201          }
     202          strcpy(pp, listfile);
     203          pp += strlen(listfile);
    201204        }
    202205        p += 2;
Note: See TracChangeset for help on using the changeset viewer.