Changeset 907 for trunk/dll/arccnrs.c
- Timestamp:
- Jan 6, 2008, 8:26:17 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r906 r907 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 11 Jun 02 SHL Ensure archive name not garbage … … 52 52 ***********************************************************************/ 53 53 54 #include <stdlib.h> // free.. 55 #include <string.h> 56 #include <ctype.h> 57 #include <direct.h> // rmdir 58 #include <share.h> // SH_DENYWR 59 #include <limits.h> // ULONG_MAX 60 #include <process.h> // _beginthread 61 62 #if 0 63 #include <malloc.h> // _heapchk 64 #endif 65 54 66 #define INCL_DOS 55 67 #define INCL_DOSERRORS 56 68 #define INCL_WIN 57 #define INCL_GPI58 69 #define INCL_LONGLONG 59 #include <os2.h> 60 61 #include <stdarg.h> 62 #include <stdio.h> 63 #include <stdlib.h> 64 #include <string.h> 65 #include <ctype.h> 66 #include <time.h> 67 #include <direct.h> 68 #include <share.h> 69 #include <limits.h> 70 #include <process.h> // _beginthread 71 72 #if 0 73 #include <malloc.h> // _heapchk 74 #endif 75 76 #include "fm3dll.h" 70 71 #include "arccnrs.h" // StartArcCnr 77 72 #include "fm3dlg.h" 78 73 #include "fm3str.h" 79 74 #include "mle.h" 75 #include "pathutil.h" // BldFullPathName 76 #include "filldir.h" // EmptyCnr... 77 #include "errutil.h" // Dos_Error... 78 #include "strutil.h" // GetPString 79 #include "fm3dll.h" 80 80 81 81 #pragma data_seg(DATA1) … … 83 83 static INT DefArcSortFlags; 84 84 static PSZ pszSrcFile = __FILE__; 85 86 /**87 * Build quoted full path name in callers buffer given88 * directory name and filename89 * @param pszPathName points to drive/directory if not NULL90 * @returns pointer to quoted path name in caller's buffer91 */92 93 PSZ BldQuotedFullPathName(PSZ pszFullPathName, PSZ pszPathName, PSZ pszFileName)94 {95 UINT c = pszPathName ? strlen(pszPathName) : 0;96 BOOL q = needs_quoting(pszPathName) ||97 needs_quoting(pszFileName);98 PSZ psz = pszFullPathName;99 100 if (q)101 *psz++ = '"';102 if (c > 0) {103 memcpy(psz, pszPathName, c);104 psz += c;105 if (*(psz - 1) != '\\')106 *psz++ = '\\';107 }108 strcpy(psz, pszFileName);109 if (q) {110 psz += strlen(psz);111 *psz++ = '"';112 *psz = 0;113 }114 return pszFullPathName;115 }116 117 /**118 * Build quoted full path name in callers buffer given a filename119 * @returns pointer to quoted file name in caller's buffer120 */121 122 PSZ BldQuotedFileName(PSZ pszQuotedFileName, PSZ pszFileName)123 {124 BOOL q = needs_quoting(pszFileName);125 PSZ psz = pszQuotedFileName;126 127 if (q)128 *psz++ = '"';129 strcpy(psz, pszFileName);130 if (q) {131 psz += strlen(psz);132 *psz++ = '"';133 *psz = 0;134 }135 return pszQuotedFileName;136 }137 85 138 86 static MRESULT EXPENTRY ArcErrProc(HWND hwnd, ULONG msg, MPARAM mp1, … … 202 150 if (*viewer) { 203 151 ExecOnList((HWND) 0, viewer, WINDOWED | SEPARATE | 204 205 152 (fViewChild ? CHILD : 0), 153 NULL, list, NULL, pszSrcFile, __LINE__); 206 154 } 207 155 else … … 271 219 case SORT_LWDATE: 272 220 ret = TestCDates(&pai1->date, &pai1->time, 273 274 221 &pai2->date, &pai2->time); 222 /*(pai1->date.year < pai2->date.year) ? 1 : 275 223 (pai1->date.year > pai2->date.year) ? -1 : 276 224 (pai1->date.month < pai2->date.month) ? 1 : … … 1518 1466 free(s); 1519 1467 if (IsFile(filename) == 1) { 1468 #if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 1520 1469 if (fViewChild && fArcStuffVisible) 1521 1470 DosSleep(100); // Allow unzip session to finish closing 14 Mar 07 SHL 1471 #endif 1522 1472 WinSendMsg(dcd->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID); 1523 1473 } … … 1578 1528 1579 1529 if (IsFile(li->list[x])) 1580 1530 BldQuotedFileName(szBuffer + strlen(szBuffer), li->list[x]); 1581 1531 else 1582 1532 BldQuotedFullPathName(szBuffer + strlen(szBuffer), li->list[x], "*"); 1583 1533 1584 1534 x++; … … 1586 1536 strlen(li->list[x]) + 5 > 1024) { 1587 1537 runemf2(SEPARATE | WINDOWED | 1588 1589 1590 1538 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) | 1539 WAIT, hwnd, pszSrcFile, __LINE__, 1540 NULL, NULL, "%s", szBuffer); 1591 1541 *p = 0; 1592 1542 } … … 1696 1646 CHAR fullname[CCHMAXPATH * 2]; 1697 1647 CHAR **exfiles = NULL; 1698 INT numfiles = 0, numalloc = 0;1648 UINT numfiles = 0, numalloc = 0; 1699 1649 1700 1650 for (x = 0; li->list[x]; x++) { … … 1767 1717 runemf2(SEPARATE | WINDOWED | 1768 1718 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) | 1769 1770 1719 WAIT, hwnd, pszSrcFile, __LINE__, 1720 li->targetpath, NULL, "%s", cl); 1771 1721 *endofit = 0; 1772 1722 } while (li->list[x]); … … 1826 1776 WINDOWED | SEPARATEKEEP | PROMPT, 1827 1777 li->targetpath, 1828 1829 1778 NULL, GetPString(IDS_EXECARCFILETITLETEXT), 1779 pszSrcFile, __LINE__); 1830 1780 else if (li->type == IDM_VIRUSSCAN) 1831 1781 ExecOnList(hwnd, virus, PROMPT | WINDOWED | SEPARATEKEEP, 1832 1782 li->targetpath, NULL, 1833 1834 1783 GetPString(IDS_VIRUSSCANARCHIVETITLETEXT), 1784 pszSrcFile, __LINE__); 1835 1785 else if (li->type == IDM_VIEW || li->type == IDM_VIEWTEXT || 1836 1786 li->type == IDM_VIEWBINARY || li->type == IDM_EDIT || … … 1966 1916 case IDM_FIND: 1967 1917 { 1968 INT numfiles = 0, numalloced = 0;1918 UINT numfiles = 0, numalloced = 0; 1969 1919 CHAR **list2 = NULL, fullname[CCHMAXPATH * 2], *p; 1970 1920 … … 2831 2781 runemf2(SEPARATE | WINDOWED | 2832 2782 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 2833 2834 2783 hwnd, pszSrcFile, __LINE__, 2784 dcd->directory, NULL, "%s %s", dcd->info->extract, 2835 2785 BldQuotedFileName(szQuotedArcName, dcd->arcname)); 2836 2786 if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTEXIT) … … 2843 2793 runemf2(SEPARATE | WINDOWED | 2844 2794 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 2845 2846 2795 hwnd, pszSrcFile, __LINE__, 2796 dcd->directory, NULL, "%s %s", 2847 2797 dcd->info->exwdirs, 2848 2798 BldQuotedFileName(szQuotedArcName, dcd->arcname));
Note:
See TracChangeset
for help on using the changeset viewer.