Changeset 1069 for trunk/dll/arccnrs.c
- Timestamp:
- Jul 17, 2008, 1:53:38 AM (17 years ago)
- File:
-
- 1 edited
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 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) {
Note:
See TracChangeset
for help on using the changeset viewer.