Changeset 1082
- Timestamp:
- Jul 20, 2008, 12:37:36 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/av2.c
r907 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2007 Steven H. Levine9 Copyright (c) 2007, 2008 Steven H. Levine 10 10 11 11 23 Sep 07 SHL Sync with standards -
trunk/databar.c
r907 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2005 Steven H. Levine9 Copyright (c) 2005, 2008 Steven H. Levine 10 10 11 11 Oct 15 21:42:56 2002 967 ______ databar.c -
trunk/dll/arccnrs.c
r1078 r1082 55 55 14 Jul 08 JBS Ticket 126: Add support for WPS open default & open settings in arccnrs 56 56 16 Jul 08 GKY Fix trap on viewing multiple files from an archive (misplaced free) 57 16 J UL 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 58 58 59 59 ***********************************************************************/ … … 424 424 HFILE newstdout; 425 425 CHAR s[CCHMAXPATH * 2], lonename[CCHMAXPATH + 2], 426 *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[CCHMAXPATH];426 *nsize, *osize, *fdate, *fname, *p, *pp, *arctemp; 427 427 BOOL gotstart; 428 428 BOOL gotend; … … 442 442 if (!info) 443 443 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++) { 445 447 sprintf(arctemp, "%s.%03x", ArcTempRoot, (clock() & 4095L)); 446 448 if (IsFile(arctemp) == 1) … … 448 450 else 449 451 break; 450 } 452 } */ 453 454 //printf("%s\r", arctemp); fflush(stdout); 451 455 452 456 ReTry: … … 508 512 else { 509 513 fp = xfopen(arctemp, "w", pszSrcFile, __LINE__); 510 if (!fp) 511 return 0; 514 if (!fp) { 515 xfree(arctemp, pszSrcFile, __LINE__); 516 return 0; 517 } 512 518 else { 513 519 newstdout = -1; … … 516 522 if (rc) { 517 523 Dos_Error(MB_CANCEL, rc, hwndCnr, pszSrcFile, __LINE__, 518 "DosDupHandle"); 524 "DosDupHandle"); 525 xfree(arctemp, pszSrcFile, __LINE__); 519 526 return 0; 520 527 } … … 526 533 Dos_Error(MB_CANCEL, rc, hwndCnr, pszSrcFile, __LINE__, 527 534 "DosDupHandle"); 528 return 0; 535 xfree(arctemp, pszSrcFile, __LINE__); 536 return 0; 529 537 } 530 538 else { … … 786 794 DosError(FERR_DISABLEHARDERR); 787 795 DosForceDelete(arctemp); 796 xfree(arctemp, pszSrcFile, __LINE__); 788 797 } 789 798 … … 1484 1493 free(s); 1485 1494 if (IsFile(filename) == 1) { 1486 #if 0// 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing1495 #if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 1487 1496 if (fViewChild && fArcStuffVisible) 1488 1497 DosSleep(100); // Allow unzip session to finish closing 14 Mar 07 SHL … … 1769 1778 if (p) { 1770 1779 BldFullPathName(p, li->targetpath, temp); 1771 /*strcpy(p, li->targetpath);1772 if (p[strlen(p) - 1] != '\\')1773 strcat(p, "\\");1774 strcat(p, temp);*/1775 1780 li->list[x] = p; 1776 1781 free(temp); … … 3535 3540 dcd->id = id; 3536 3541 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] != '\\') 3540 3546 strcat(dcd->workdir, "\\"); 3541 3547 sprintf(dcd->workdir + strlen(dcd->workdir), "%s.%03x", 3542 3548 ArcTempRoot, (clock() & 4095)); 3543 }3544 3549 else 3545 3550 sprintf(dcd->workdir, "%s.%03x", 3546 ArcTempRoot, (clock() & 4095)); 3551 ArcTempRoot, (clock() & 4095));*/ 3547 3552 strcpy(dcd->arcname, fullname); 3548 3553 if (*extractpath) { -
trunk/dll/assoc.c
r1039 r1082 18 18 29 Feb 08 GKY Changes to enable user settable command line length 19 19 29 Feb 08 GKY Use xfree where appropriate 20 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 20 21 21 22 **************************************************************************************/ … … 142 143 free_associations(); 143 144 assloaded = TRUE; 144 save_dir2(mask); 145 BldFullPathName(mask, pFM2SaveDirectory, "ASSOC.DAT"); 146 /*save_dir2(mask); 145 147 if (mask[strlen(mask) - 1] != '\\') 146 148 strcat(mask, "\\"); 147 strcat(mask, "ASSOC.DAT"); 149 strcat(mask, "ASSOC.DAT");*/ 148 150 fp = _fsopen(mask, "r", SH_DENYWR); 149 151 pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); … … 267 269 } 268 270 #endif 269 save_dir2(s);271 /*save_dir2(s); 270 272 if (s[strlen(s) - 1] != '\\') 271 273 strcat(s, "\\"); 272 strcat(s, "ASSOC.DAT"); 274 strcat(s, "ASSOC.DAT");*/ 275 BldFullPathName(s, pFM2SaveDirectory, "ASSOC.DAT"); 273 276 fp = xfopen(s, "w", pszSrcFile, __LINE__); 274 277 if (fp) { -
trunk/dll/avl.c
r1039 r1082 31 31 25 Aug 07 SHL load_archivers: add missing close on error path 32 32 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 34 35 35 36 ***********************************************************************/ … … 218 219 } 219 220 221 # ifdef FORTIFY 222 220 223 VOID free_archivers(VOID) 221 224 { … … 247 250 248 251 //=== free_arc_type() free allocated ARC_TYPE === 252 253 # endif 249 254 250 255 VOID free_arc_type(ARC_TYPE * pat) -
trunk/dll/cmdline.c
r1039 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 200 7Steven H.Levine9 Copyright (c) 2004, 2008 Steven H.Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 18 18 29 Feb 08 GKY Use xfree where appropriate 19 19 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 20 21 21 22 ***********************************************************************/ … … 74 75 else 75 76 MiniLoaded = TRUE; 76 save_dir2(pszCmdLine); 77 BldFullPathName(pszCmdLine, pFM2SaveDirectory, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 78 /*save_dir2(pszCmdLine); 77 79 if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 78 80 strcat(pszCmdLine, "\\"); 79 strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 81 strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT");*/ 80 82 fp = _fsopen(pszCmdLine, "r", SH_DENYWR); 81 83 if (fp) { … … 130 132 if (!pszCmdLine) 131 133 return; 132 save_dir2(pszCmdLine); 134 BldFullPathName(pszCmdLine, pFM2SaveDirectory, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 135 /*save_dir2(pszCmdLine); 133 136 if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 134 137 strcat(pszCmdLine, "\\"); 135 strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT"); 138 strcat(pszCmdLine, (DoItYourself) ? "CMDLINES.DAT" : "CMDMINI.DAT");*/ 136 139 if (CmdLineHead) { 137 140 fp = xfopen(pszCmdLine, "w", pszSrcFile, __LINE__); -
trunk/dll/command.c
r1078 r1082 25 25 29 Feb 08 GKY Use xfree where appropriate 26 26 18 Jul 08 SHL Add Fortify support 27 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 27 28 28 29 ***********************************************************************/ … … 331 332 pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 332 333 if (pszCmdLine) { 333 save_dir2(pszCmdLine); 334 BldFullPathName(pszCmdLine, pFM2SaveDirectory, "COMMANDS.DAT"); 335 /*save_dir2(pszCmdLine); 334 336 if (pszCmdLine[strlen(pszCmdLine) - 1] != '\\') 335 337 strcat(pszCmdLine, "\\"); 336 strcat(pszCmdLine, "COMMANDS.DAT"); 338 strcat(pszCmdLine, "COMMANDS.DAT");*/ 337 339 fp = _fsopen(pszCmdLine, "r", SH_DENYWR); 338 340 if (fp) { … … 399 401 return; 400 402 info = cmdhead; 401 save_dir2(s); 403 BldFullPathName(s, pFM2SaveDirectory, "COMMANDS.DAT"); 404 /*save_dir2(s); 402 405 if (s[strlen(s) - 1] != '\\') 403 406 strcat(s, "\\"); 404 strcat(s, "COMMANDS.DAT"); 407 strcat(s, "COMMANDS.DAT");*/ 405 408 fp = xfopen(s, "w", pszSrcFile, __LINE__); 406 409 if (fp) { -
trunk/dll/copyf.c
r1039 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 200 6Steven H.Levine9 Copyright (c) 2001, 2008 Steven H.Levine 10 10 11 11 14 Sep 02 SHL Drop obsolete debug code … … 19 19 01 Sep 07 GKY Use xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundry 20 20 29 Feb 08 GKY Use xfree where appropriate 21 19 Jul 08 GKY Modify MakeTempName for use making temp directory names 21 22 22 23 ***********************************************************************/ … … 49 50 #endif 50 51 51 char *MakeTempName(char *buffer )52 char *MakeTempName(char *buffer, char *temproot, INT type) 52 53 { 53 54 FILESTATUS3 fs3; … … 55 56 char *p, *o; 56 57 58 if (strlen(buffer) > 3 && buffer[strlen(buffer) - 1] != '\\') 59 strcat(buffer, "\\"); 57 60 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 } 59 74 p = buffer + (strlen(buffer) - 1); 60 75 for (;;) { … … 510 525 *p = 0; 511 526 strcat(dir, "\\"); 512 MakeTempName(dir );527 MakeTempName(dir, NULL, 0); 513 528 if (DosMove(fullnewname, dir)) 514 529 *dir = 0; … … 894 909 #pragma alloc_text(LONGNAMES,TruncName,GetLongName,WriteLongName) 895 910 #pragma alloc_text(LONGNAMES,ZapLongName,AdjustWildcardName) 896 #pragma alloc_text(COPYF,default_disk,docopyf )911 #pragma alloc_text(COPYF,default_disk,docopyf,MakeTempName) 897 912 #pragma alloc_text(UNLINKF,unlinkf,unlink_allf,make_deleteable,wipeallf) -
trunk/dll/dircnrs.c
r1079 r1082 70 70 #include "command.h" // RunCommand 71 71 #include "fm3dll.h" 72 #include "avl.h" // free_archivers72 //#include "avl.h" // free_archivers 73 73 #ifdef FORTIFY 74 74 #include "misc.h" // GetTidForThread -
trunk/dll/dirsize.c
r1067 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 200 7Steven H. Levine9 Copyright (c) 2001, 2008 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 34 34 29 Feb 08 GKY Add presparams & update appearence of "Sizes" dialog 35 35 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 isroot36 07 Jul 08 GKY Fixed trap by no longer allocating pci->pszLongName as flag but pointing isroot 37 37 version to NullStr and all others to NULL. 38 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory; use pTmpDir for temp files 38 39 39 40 ***********************************************************************/ … … 927 928 FILE *fp; 928 929 929 save_dir2(szFileName); 930 if (pTmpDir) 931 strcpy(szFileName, pTmpDir); 932 else 933 strcpy(szFileName, pFM2SaveDirectory); 934 //save_dir2(szFileName); 930 935 sprintf(&szFileName[strlen(szFileName)], "\\%csizes.Rpt", 931 936 (pState) ? toupper(*pState->szDirName) : '+'); -
trunk/dll/filter.c
r1039 r1082 15 15 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 16 16 29 Feb 08 GKY Use xfree where appropriate 17 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 17 18 18 19 ***********************************************************************/ … … 30 31 #include "errutil.h" // Dos_Error... 31 32 #include "strutil.h" // GetPString 33 #include "pathutil.h" // BldFullPathName 32 34 #include "fm3dll.h" 33 35 #include "fortify.h" … … 133 135 134 136 loadedmasks = TRUE; 135 save_dir2(s); 137 BldFullPathName(s, pFM2SaveDirectory, "FILTER.DAT"); 138 /*save_dir2(s); 136 139 if (s[strlen(s) - 1] != '\\') 137 140 strcat(s, "\\"); 138 strcat(s, "FILTERS.DAT"); 141 strcat(s, "FILTERS.DAT");*/ 139 142 fp = _fsopen(s, "r", SH_DENYWR); 140 143 if (fp) { … … 175 178 return; 176 179 if (maskhead) { 177 save_dir2(s); 180 BldFullPathName(s, pFM2SaveDirectory, "FILTER.DAT"); 181 /*save_dir2(s); 178 182 if (s[strlen(s) - 1] != '\\') 179 183 strcat(s, "\\"); 180 strcat(s, "FILTERS.DAT"); 184 strcat(s, "FILTERS.DAT");*/ 181 185 fp = xfopen(s, "w", pszSrcFile, __LINE__); 182 186 if (fp) { -
trunk/dll/fm3dll.h
r1076 r1082 84 84 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 85 85 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 86 87 87 88 ***********************************************************************/ … … 229 230 #define ALLATTRS (FILE_NORMAL | FILE_DIRECTORY | FILE_ARCHIVED |\ 230 231 FILE_HIDDEN | FILE_READONLY | FILE_SYSTEM) 231 #define LISTTEMPROOT "$FM2LI$T."232 //#define LISTTEMPROOT "$FM2LI$T" 232 233 233 234 #include "fm3dll2.h" … … 630 631 CHAR default_disk(VOID); 631 632 APIRET docopyf(INT type, CHAR * oldname, CHAR * newname, ...); 633 char *MakeTempName(char *buffer, char *temproot, int type); 632 634 633 635 #define COPY 0 … … 1111 1113 hwndLED, hwndLEDHdr, hwndAutoMLE, hwndCmdlist; 1112 1114 DATADEF HBITMAP hbmLEDon, hbmLEDoff; 1113 DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir ;1115 DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir, *pFM2SaveDirectory; 1114 1116 DATADEF HPOINTER hptrArrow, hptrBusy, hptrLast, hptrDir, hptrFile, hptrRemote, 1115 1117 hptrFloppy, hptrDrive, hptrRemovable, hptrCDROM,hptrVirtual,hptrRamdisk, -
trunk/dll/grep2.c
r1063 r1082 20 20 06 Aug 07 GKY Reduce DosSleep times (ticket 148) 21 21 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 22 23 23 24 fixme for more excess locals to be gone … … 42 43 #include "errutil.h" // Dos_Error... 43 44 #include "strutil.h" // GetPString 45 #include "pathutil.h" // BldFullPathName 44 46 #include "fm3dll.h" 45 47 #include "fortify.h" … … 268 270 WinEnableWindow(WinWindowFromID(hwnd, GREP_NOSIZEDUPES), FALSE); 269 271 270 save_dir2(s); 272 BldFullPathName(s, pFM2SaveDirectory, "GREPMASK.DAT"); 273 /*save_dir2(s); 271 274 if (s[strlen(s) - 1] != '\\') 272 275 strcat(s, "\\"); 273 strcat(s, "GREPMASK.DAT"); 276 strcat(s, "GREPMASK.DAT");*/ 274 277 fp = _fsopen(s, "r", SH_DENYWR); 275 278 if (fp) { … … 947 950 LM_QUERYITEMCOUNT, 948 951 MPVOID, MPVOID); 949 if (sSelect > 0) { 950 save_dir2(s); 952 if (sSelect > 0) { 953 BldFullPathName(s, pFM2SaveDirectory, "GREPMASK.DAT"); 954 /*save_dir2(s); 951 955 if (s[strlen(s) - 1] != '\\') 952 956 strcat(s, "\\"); 953 strcat(s, "GREPMASK.DAT"); 957 strcat(s, "GREPMASK.DAT");*/ 954 958 fp = xfopen(s, "w", pszSrcFile, __LINE__); 955 959 if (fp) { -
trunk/dll/inis.c
r1063 r1082 26 26 09 Jan 08 SHL Use CloseProfile to avoid spurious system INI closes 27 27 29 Feb 08 GKY Use xfree where appropriate 28 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory or pTmpDir and use BldFullPathName 28 29 29 30 ***********************************************************************/ … … 46 47 #include "errutil.h" // Dos_Error... 47 48 #include "strutil.h" // GetPString 49 #include "pathutil.h" // BldFullPathName 48 50 #include "fm3dll.h" 49 51 #include "fortify.h" … … 1134 1136 /* make copies of new inis */ 1135 1137 *tempuserini = 0; 1136 *tempsysini = 0; 1137 save_dir2(tempuserini); 1138 *tempsysini = 0; 1139 BldFullPathName(tempuserini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPUSER.INI"); 1140 /*save_dir2(tempuserini); 1138 1141 if (tempuserini[strlen(tempuserini) - 1] != '\\') 1139 1142 strcat(tempuserini, "\\"); 1140 strcat(tempuserini, "TEMPUSER.INI"); 1143 strcat(tempuserini, "TEMPUSER.INI");*/ 1141 1144 rc = DosCopy(userini, tempuserini, DCPY_EXISTING); 1142 1145 if (rc) { … … 1148 1151 GetPString(IDS_COMPCOPYFAILEDTEXT), userini, tempuserini); 1149 1152 break; 1150 } 1151 save_dir2(tempsysini); 1153 } 1154 BldFullPathName(tempsysini, pTmpDir ? pTmpDir : pFM2SaveDirectory, "TEMPSYS.INI"); 1155 /*save_dir2(tempsysini); 1152 1156 if (tempsysini[strlen(tempsysini) - 1] != '\\') 1153 1157 strcat(tempsysini, "\\"); 1154 strcat(tempsysini, "TEMPSYS.INI"); 1158 strcat(tempsysini, "TEMPSYS.INI");*/ 1155 1159 rc = DosCopy(sysini, tempsysini, DCPY_EXISTING); 1156 1160 if (rc) { -
trunk/dll/init.c
r1077 r1082 51 51 16 JUL 08 GKY Use TMP directory for temp files 52 52 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). 53 54 54 55 ***********************************************************************/ … … 514 515 } 515 516 } 516 517 save_dir(s); 517 if (pTmpDir) 518 strcpy(s, pTmpDir); 519 else 520 save_dir2(s); 518 521 if (s[strlen(s) - 1] != '\\') 519 522 strcat(s, "\\"); 520 523 enddir = &s[strlen(s)]; 521 strcat(s, LISTTEMPROOT);524 strcat(s, "$FM2LI$T"); 522 525 strcat(s, "???"); 523 526 search_handle = HDIR_CREATE; … … 541 544 BldFullPathName(szTempFile, pTmpDir, "$FM2PLAY.$$$"); 542 545 DosForceDelete(szTempFile); 546 if (pTmpDir) { 547 wipeallf("%s\\*", pTmpDir); 548 DosDeleteDir(pTmpDir); 549 } 543 550 EndNote(); 544 551 if (FM3ModHandle) … … 650 657 } 651 658 652 / * set up default root names for temp archive goodies */659 // set up default root names for temp file storage and archive goodies 653 660 env = getenv("TMP"); 654 661 if (env == NULL) … … 659 666 if (!rc) { 660 667 if (fs3.attrFile & FILE_DIRECTORY) { 661 // 17 Jul 08 SHL fixme to check writable someday 662 pTmpDir = xstrdup(env, pszSrcFile, __LINE__); 668 CHAR szTempName[CCHMAXPATH]; 669 APIRET ret = 0; 670 // 17 Jul 08 SHL fixme to check writable someday 671 strcpy(szTempName, env); 672 //if (szTempName[strlen(szTempName) - 1] != '\\') 673 // strcat(szTempName, "\\"); 674 MakeTempName(szTempName, NULL, 1); 675 ret = DosCreateDir(szTempName, 0); 676 if (!ret) { 677 pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__); 678 } 663 679 } 664 680 } … … 666 682 BldFullPathName(ArcTempRoot, pTmpDir, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 667 683 668 /* initialize random number generator */ 684 //Save the FM2 save directory name. This is the location of the ini, dat files etc. 685 { 686 CHAR temp[CCHMAXPATH]; 687 save_dir2(temp); 688 pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__); 689 } 690 691 // initialize random number generator 669 692 srand(time(NULL) + clock()); 670 693 -
trunk/dll/loadbmp.c
r1009 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2006, 200 7Steven H. Levine9 Copyright (c) 2006, 2008 Steven H. Levine 10 10 11 11 22 Jul 06 SHL Check more run time errors … … 15 15 16 Jan 07 SHL Beautify with indent -i2 16 16 18 Apr 08 SHL LoadBitmapFromFile ensure pf initialized if no hPS 17 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory 18 17 19 ***********************************************************************/ 18 20 … … 36 38 char s[CCHMAXPATH]; 37 39 38 save_dir2(s); 40 //save_dir2(s); 41 strcpy(s, pFM2SaveDirectory); 39 42 sprintf(s + strlen(s), "\\%u.BMP", id); 40 43 return LoadBitmapFromFile(s); -
trunk/dll/remap.c
r1039 r1082 5 5 6 6 Copyright (c) 1993, 1998 M. Kimes 7 Copyright (c) 2004, 200 6Steven H.Levine7 Copyright (c) 2004, 2008 Steven H.Levine 8 8 9 9 01 Aug 04 SHL Rework lstrip/rstrip usage … … 14 14 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 15 15 29 Feb 08 GKY Use xfree where appropriate 16 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 16 17 17 18 ***********************************************************************/ … … 30 31 #include "errutil.h" // Dos_Error... 31 32 #include "strutil.h" // GetPString 33 #include "pathutil.h" // BldFullPathName 32 34 #include "fm3dll.h" 33 35 #include "fortify.h" … … 71 73 72 74 loadedres = TRUE; 73 save_dir2(s); 75 BldFullPathName(s, pFM2SaveDirectory, "RESOURCE.DAT"); 76 /*save_dir2(s); 74 77 if (s[strlen(s) - 1] != '\\') 75 78 strcat(s, "\\"); 76 strcat(s, "RESOURCE.DAT"); 79 strcat(s, "RESOURCE.DAT");*/ 77 80 fp = _fsopen(s, "r", SH_DENYWR); 78 81 if (fp) { … … 112 115 if (!loadedres) 113 116 return; 114 save_dir2(s); 117 BldFullPathName(s, pFM2SaveDirectory, "RESOURCE.DAT"); 118 /*save_dir2(s); 115 119 if (s[strlen(s) - 1] != '\\') 116 120 strcat(s, "\\"); 117 strcat(s, "RESOURCE.DAT"); 121 strcat(s, "RESOURCE.DAT");*/ 118 122 if (reshead) { 119 123 fp = xfopen(s, "w", pszSrcFile, __LINE__); -
trunk/dll/saveclip.c
r1047 r1082 22 22 30 Dec 07 GKY Use CommaFmtULL 23 23 16 Feb 08 GKY Changed _fsopen flag so a new list file can be created 24 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 24 25 25 26 ***********************************************************************/ … … 37 38 #include "errutil.h" // Dos_Error... 38 39 #include "strutil.h" // GetPString 40 #include "pathutil.h" // BldFullPathName 39 41 #include "fm3dll.h" 40 42 #include "fortify.h" … … 237 239 CHAR s[CCHMAXPATH + 14]; 238 240 239 save_dir2(s); 241 BldFullPathName(s, pFM2SaveDirectory, "PATTERNS.DAT"); 242 /*save_dir2(s); 240 243 if (s[strlen(s) - 1] != '\\') 241 244 strcat(s, "\\"); 242 strcat(s, "PATTERNS.DAT"); 245 strcat(s, "PATTERNS.DAT");*/ 243 246 fp = _fsopen(s, "r", SH_DENYWR); 244 247 if (fp) { … … 267 270 LM_QUERYITEMCOUNT, MPVOID, MPVOID); 268 271 if (sMax > 0) { 269 save_dir2(szBuffer); 272 BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT"); 273 /*save_dir2(szBuffer); 270 274 if (szBuffer[strlen(szBuffer) - 1] != '\\') 271 275 strcat(szBuffer, "\\"); 272 strcat(szBuffer, "PATTERNS.DAT"); 276 strcat(szBuffer, "PATTERNS.DAT");*/ 273 277 fp = xfopen(szBuffer, "w", pszSrcFile, __LINE__); 274 278 if (fp) { … … 287 291 } 288 292 else if (!sMax) { 289 save_dir2(szBuffer); 293 BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT"); 294 /*save_dir2(szBuffer); 290 295 if (szBuffer[strlen(szBuffer) - 1] != '\\') 291 296 strcat(szBuffer, "\\"); 292 strcat(szBuffer, "PATTERNS.DAT"); 297 strcat(szBuffer, "PATTERNS.DAT");*/ 293 298 unlinkf("%s", szBuffer); 294 299 } … … 598 603 CHAR s[CCHMAXPATH + 14]; 599 604 600 save_dir2(s); 605 BldFullPathName(s, pFM2SaveDirectory, "PATTERNS.DAT"); 606 /*save_dir2(s); 601 607 if (s[strlen(s) - 1] != '\\') 602 608 strcat(s, "\\"); 603 strcat(s, "PATTERNS.DAT"); 609 strcat(s, "PATTERNS.DAT");*/ 604 610 fp = _fsopen(s, "r", SH_DENYWR); 605 611 if (fp) { … … 629 635 LM_QUERYITEMCOUNT, MPVOID, MPVOID); 630 636 if (sMax > 0) { 631 save_dir2(szBuffer); 637 BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT"); 638 /*save_dir2(szBuffer); 632 639 if (szBuffer[strlen(szBuffer) - 1] != '\\') 633 640 strcat(szBuffer, "\\"); 634 strcat(szBuffer, "PATTERNS.DAT"); 641 strcat(szBuffer, "PATTERNS.DAT");*/ 635 642 fp = xfopen(szBuffer, "w", pszSrcFile, __LINE__); 636 643 if (fp) { … … 649 656 } 650 657 else if (!sMax) { 651 save_dir2(szBuffer); 658 BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT"); 659 /*save_dir2(szBuffer); 652 660 if (szBuffer[strlen(szBuffer) - 1] != '\\') 653 661 strcat(szBuffer, "\\"); 654 strcat(szBuffer, "PATTERNS.DAT"); 662 strcat(szBuffer, "PATTERNS.DAT");*/ 655 663 unlinkf("%s", szBuffer); 656 664 } -
trunk/dll/systemf.c
r1047 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2003, 200 6Steven H.Levine9 Copyright (c) 2003, 2008 Steven H.Levine 10 10 11 11 21 Nov 03 SHL Comments … … 23 23 29 Feb 08 GKY Refactor global command line variables to notebook.h 24 24 26 May 08 SHL Use uiLineNumber correctly 25 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory or pTmpDir and use MakeTempName 25 26 26 27 ***********************************************************************/ … … 181 182 FILE *fp; 182 183 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); 201 204 } 202 205 p += 2; -
trunk/dll/tools.c
r1079 r1082 18 18 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 19 19 29 Feb 08 GKY Use xfree where appropriate 20 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 20 21 21 22 ***********************************************************************/ … … 34 35 #include "errutil.h" // Dos_Error... 35 36 #include "strutil.h" // GetPString 37 #include "pathutil.h" // BldFullPathName 36 38 #include "fortify.h" 37 39 #include "fm3dll.h" … … 60 62 return; 61 63 } 62 save_dir2(s); 64 BldFullPathName(s, pFM2SaveDirectory, "QUICKTLS.DAT"); 65 /*save_dir2(s); 63 66 if (s[strlen(s) - 1] != '\\') 64 67 strcat(s, "\\"); 65 strcat(s, "QUICKTLS.DAT"); 68 strcat(s, "QUICKTLS.DAT");*/ 66 69 fp = _fsopen(s, "r", SH_DENYWR); 67 70 if (fp) { … … 93 96 if (!quicktool[0]) 94 97 return; 95 save_dir2(s); 98 BldFullPathName(s, pFM2SaveDirectory, "QUICKTLS.DAT"); 99 /*save_dir2(s); 96 100 if (s[strlen(s) - 1] != '\\') 97 101 strcat(s, "\\"); 98 strcat(s, "QUICKTLS.DAT"); 102 strcat(s, "QUICKTLS.DAT");*/ 99 103 fp = xfopen(s, "w", pszSrcFile, __LINE__); 100 104 if (fp) { -
trunk/dll/viewinf.c
r1063 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 200 6Steven H.Levine9 Copyright (c) 2004, 2008 Steven H.Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 14 14 03 Nov 06 SHL Count thread usage 15 15 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 16 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 16 17 17 18 ***********************************************************************/ … … 32 33 #include "errutil.h" // Dos_Error... 33 34 #include "strutil.h" // GetPString 35 #include "pathutil.h" // BldFullPathName 34 36 #include "fm3dll.h" 35 37 #include "fortify.h" … … 540 542 ViewHelp(p); 541 543 break; 542 } 543 save_dir2(filename); 544 } 545 BldFullPathName(filename, pFM2SaveDirectory, "FM2VINF.CMD"); 546 /*save_dir2(filename); 544 547 if (filename[strlen(filename) - 1] != '\\') 545 548 strcat(filename, "\\"); 546 strcat(filename, "FM2VINF.CMD"); 549 strcat(filename, "FM2VINF.CMD");*/ 547 550 fp = xfopen(filename, "w", pszSrcFile, __LINE__); 548 551 if (fp) { -
trunk/dll/walkem.c
r1078 r1082 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2005, 200 7Steven H. Levine9 Copyright (c) 2005, 2008 Steven H. Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 32 32 22 Jun 08 GKY Add free_?dir for fortify testing 33 33 18 Jul 08 SHL More Fortify support 34 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 34 35 35 36 ***********************************************************************/ … … 51 52 #include "strutil.h" // GetPString 52 53 #include "notebook.h" // targetdirectory 54 #include "pathutil.h" // BldFullPathName 53 55 #include "fm3dll.h" 54 56 #include "fortify.h" … … 354 356 loadedudirs = TRUE; 355 357 fUdirsChanged = FALSE; 356 save_dir2(s); 358 BldFullPathName(s, pFM2SaveDirectory, "USERDIRS.DAT"); 359 /*save_dir2(s); 357 360 if (s[strlen(s) - 1] != '\\') 358 361 strcat(s, "\\"); 359 strcat(s, "USERDIRS.DAT"); 362 strcat(s, "USERDIRS.DAT");*/ 360 363 fp = _fsopen(s, "r", SH_DENYWR); 361 364 if (fp) { … … 403 406 fUdirsChanged = FALSE; 404 407 if (udirhead) { 405 save_dir2(s); 408 BldFullPathName(s, pFM2SaveDirectory, "USERDIRS.DAT"); 409 /*save_dir2(s); 406 410 if (s[strlen(s) - 1] != '\\') 407 411 strcat(s, "\\"); 408 strcat(s, "USERDIRS.DAT"); 412 strcat(s, "USERDIRS.DAT");*/ 409 413 fp = xfopen(s, "w", pszSrcFile, __LINE__); 410 414 if (fp) { … … 583 587 } 584 588 589 # ifdef FORTIFY 590 585 591 VOID free_ldir(VOID) 586 592 { … … 596 602 ldirhead = NULL; 597 603 } 604 605 # endif 598 606 599 607 VOID free_udirs(VOID)
Note:
See TracChangeset
for help on using the changeset viewer.