Changeset 1069
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r1068 r1069 54 54 29 Feb 08 GKY Use xfree where appropriate 55 55 14 Jul 08 JBS Ticket 126: Add support for WPS open default & open settings in arccnrs 56 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. 56 58 57 59 ***********************************************************************/ … … 422 424 HFILE newstdout; 423 425 CHAR s[CCHMAXPATH * 2], lonename[CCHMAXPATH + 2], 424 *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[ 33];426 *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[CCHMAXPATH]; 425 427 BOOL gotstart; 426 428 BOOL gotend; … … 1498 1500 1499 1501 if (li && li->list && li->list[0]) { 1502 printf("%x/r", li->type); fflush(stdout); 1500 1503 switch (li->type) { 1501 1504 case IDM_ARCHIVE: … … 1722 1725 do { 1723 1726 for (x = z; li->list[x] && 1724 strlen(pszCmdLine) + strlen(li->list[x]) < 999; x++) {1727 strlen(pszCmdLine) + strlen(li->list[x]) < MaxComLineStrg - 1 ; x++) { 1725 1728 strcat(pszCmdLine, " "); 1726 1729 BldQuotedFileName(pszCmdLine + strlen(pszCmdLine), li->list[x]); … … 1736 1739 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) | 1737 1740 WAIT, hwnd, pszSrcFile, __LINE__, 1738 li->targetpath, NULL, "%s", pszCmdLine);1741 li->targetpath, NULL, "%s", pszCmdLine); 1739 1742 *endofit = 0; 1740 1743 } while (li->list[x]); … … 1754 1757 p = xmalloc(strlen(temp) + strlen(li->targetpath) + 2, 1755 1758 pszSrcFile, __LINE__); 1756 if (p) { 1757 strcpy(p, li->targetpath); 1759 if (p) { 1760 BldFullPathName(p, li->targetpath, temp); 1761 /*strcpy(p, li->targetpath); 1758 1762 if (p[strlen(p) - 1] != '\\') 1759 1763 strcat(p, "\\"); 1760 strcat(p, temp); 1764 strcat(p, temp);*/ 1761 1765 li->list[x] = p; 1762 1766 free(temp); … … 1823 1827 } 1824 1828 } 1825 }1829 } 1826 1830 BldFullPathName(pszCmdLine, li->targetpath, li->list[x]); 1827 1831 temp = li->list[x]; 1828 1832 li->list[x] = xstrdup(pszCmdLine, pszSrcFile, __LINE__); 1829 free(pszCmdLine);1830 1833 if (!li->list[x]) 1831 1834 li->list[x] = temp; 1832 1835 else 1833 1836 xfree(temp, pszSrcFile, __LINE__); 1834 } 1837 } 1838 free(pszCmdLine); 1835 1839 if (li->type == IDM_VIEW || li->type == IDM_EDIT) { 1836 1840 … … 1852 1856 if (li->type == IDM_MCIPLAY) { 1853 1857 1854 FILE *fp; 1855 1856 fp = xfopen("$FM2PLAY.$$$", "w", pszSrcFile, __LINE__); 1858 FILE *fp; 1859 CHAR TempFile[CCHMAXPATH]; 1860 1861 if (fUseTmp) 1862 BldFullPathName(TempFile, pTmpDir, "$FM2PLAY.$$$"); 1863 else 1864 strcpy(TempFile, "$FM2PLAY.$$$"); 1865 1866 fp = xfopen(TempFile, "w", pszSrcFile, __LINE__); 1857 1867 if (fp) { 1858 1868 fprintf(fp, "%s", ";AV/2-built FM2Play listfile\n"); … … 1860 1870 fprintf(fp, "%s\n", li->list[x]); 1861 1871 fprintf(fp, ";end\n"); 1862 fclose(fp); 1863 RunFM2Util("FM2PLAY.EXE", "/@$FM2PLAY.$$$"); 1872 fclose(fp); 1873 strrev(TempFile); 1874 strcat(TempFile, "@/"); 1875 strrev(TempFile); 1876 RunFM2Util("FM2PLAY.EXE", TempFile); 1864 1877 } 1865 1878 } … … 1928 1941 } 1929 1942 } 1930 1943 1931 1944 } 1932 1945 else { … … 2948 2961 case IDM_OPENDEFAULT: 2949 2962 case IDM_OPENSETTINGS: 2963 case IDM_MCIPLAY: 2950 2964 { 2951 2965 LISTINFO *li; … … 3012 3026 case IDM_VIRUSSCAN: 3013 3027 case IDM_OPENDEFAULT: 3014 case IDM_OPENSETTINGS: 3028 case IDM_OPENSETTINGS: 3029 case IDM_MCIPLAY: 3015 3030 strcpy(li->targetpath, dcd->workdir); 3016 3031 break; … … 3514 3529 dcd->id = id; 3515 3530 dcd->type = ARC_FRAME; 3516 save_dir2(dcd->workdir); 3517 if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\') 3518 strcat(dcd->workdir, "\\"); 3519 sprintf(dcd->workdir + strlen(dcd->workdir), "%s.%03x", 3520 ArcTempRoot, (clock() & 4095)); 3531 if (!fUseTmp) { 3532 save_dir2(dcd->workdir); 3533 if (dcd->workdir[strlen(dcd->workdir) - 1] != '\\') 3534 strcat(dcd->workdir, "\\"); 3535 sprintf(dcd->workdir + strlen(dcd->workdir), "%s.%03x", 3536 ArcTempRoot, (clock() & 4095)); 3537 } 3538 else 3539 sprintf(dcd->workdir, "%s.%03x", 3540 ArcTempRoot, (clock() & 4095)); 3521 3541 strcpy(dcd->arcname, fullname); 3522 3542 if (*extractpath) { -
trunk/dll/filldir.c
r1063 r1069 197 197 char *psz; 198 198 199 psz = getenv("TMP"); 200 if (!psz && *psz) 201 psz = getenv("TEMP"); 202 if (psz && *psz) { 199 if (fUseTmp) { 200 psz = pTmpDir; 203 201 strcpy(szFileName, psz); 204 202 psz = szFileName + strlen(szFileName) - 1; -
trunk/dll/fm3dll.h
r1065 r1069 1110 1110 hwndLED, hwndLEDHdr, hwndAutoMLE, hwndCmdlist; 1111 1111 DATADEF HBITMAP hbmLEDon, hbmLEDoff; 1112 DATADEF CHAR ArcTempRoot[ 9], ThousandsSeparator[2];1112 DATADEF CHAR ArcTempRoot[CCHMAXPATH], ThousandsSeparator[2], *pTmpDir; 1113 1113 DATADEF HPOINTER hptrArrow, hptrBusy, hptrLast, hptrDir, hptrFile, hptrRemote, 1114 1114 hptrFloppy, hptrDrive, hptrRemovable, hptrCDROM,hptrVirtual,hptrRamdisk, … … 1143 1143 fFM2Deletes, fAutoAddAllDirs, fConfirmTarget, fChangeTarget, 1144 1144 fFirstTime, fShowTarget, fNoFinger, fDrivebarHelp, fCheckMM, 1145 fNoLargeFileSupport, fNoMailtoMailRun, 1145 fNoLargeFileSupport, fNoMailtoMailRun, fUseTmp, 1146 1146 fHttpRunWPSDefault, fFtpRunWPSDefault, fLibPathStrictMailRun, 1147 1147 fLibPathStrictHttpRun, fLibPathStrictFtpRun, fCancelAction, fTrashCan; -
trunk/dll/init.c
r1065 r1069 650 650 651 651 /* set up default root names for temp archive goodies */ 652 if (!fAmAV2) 653 strcpy(ArcTempRoot, "$FM$ARC$"); 654 else 655 strcpy(ArcTempRoot, "$AV$ARC$"); 652 env = getenv("TMP"); 653 if (env != NULL) { 654 DosError(FERR_DISABLEHARDERR); 655 rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3)); 656 if (!rc) { 657 if (fs3.attrFile & FILE_DIRECTORY) { 658 BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 659 pTmpDir = xstrdup(env, pszSrcFile, __LINE__); 660 fUseTmp = TRUE; 661 } 662 } 663 } 664 else { 665 env = getenv("TEMP"); 666 if (env != NULL) { 667 DosError(FERR_DISABLEHARDERR); 668 rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3)); 669 if (!rc) { 670 if (fs3.attrFile & FILE_DIRECTORY) { 671 BldFullPathName(ArcTempRoot, env, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$"); 672 pTmpDir = xstrdup(env, pszSrcFile, __LINE__); 673 fUseTmp = TRUE; 674 } 675 } 676 } 677 } 678 if (!fUseTmp) { 679 if (!fAmAV2) 680 strcpy(ArcTempRoot, "$FM$ARC$"); 681 else 682 strcpy(ArcTempRoot, "$AV$ARC$"); 683 } 656 684 657 685 /* initialize random number generator */ -
trunk/dll/worker.c
r1063 r1069 26 26 29 Feb 08 GKY Refactor global command line variables to notebook.h 27 27 22 Jun 08 GKY Made Felete move to xworkplace trash can on systems that have it 28 16 JUL 08 GKY Use TMP directory for temp files 28 29 29 30 ***********************************************************************/ … … 1067 1068 if (total > 1000) { 1068 1069 1069 FILE *fp; 1070 FILE *fp; 1071 CHAR TempFile[CCHMAXPATH]; 1072 1073 if (fUseTmp) 1074 BldFullPathName(TempFile, pTmpDir, "$FM2PLAY.$$$"); 1075 else 1076 strcpy(TempFile, "$FM2PLAY.$$$"); 1077 1078 fp = xfopen(TempFile, "w", pszSrcFile, __LINE__); 1079 if (fp) { 1080 fprintf(fp, "%s", ";AV/2-built FM2Play listfile\n"); 1081 for (x = 0; wk->li->list[x]; x++) 1082 fprintf(fp, "%s\n", wk->li->list[x]); 1083 fprintf(fp, ";end\n"); 1084 fclose(fp); 1085 strrev(TempFile); 1086 strcat(TempFile, "@/"); 1087 strrev(TempFile); 1088 RunFM2Util("FM2PLAY.EXE", TempFile); 1089 } 1090 /*FILE *fp; 1070 1091 1071 1092 fp = xfopen("$FM2PLAY.$$$", "w", pszSrcFile, __LINE__); … … 1078 1099 RunFM2Util("FM2PLAY.EXE", "/#$FM2PLAY.$$$"); 1079 1100 break; 1080 } 1101 }*/ 1081 1102 } 1082 1103 }
Note:
See TracChangeset
for help on using the changeset viewer.
