Changeset 773 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Aug 7, 2007, 11:23:27 PM (18 years ago)
Author:
Steven Levine
Message:

Correct some compare directories collector nits
Use BldQuoted... functions
Move BldQuoted... functions near primary callers
Add RUNTYPE_MASK
Use Runtime_Error2 more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r771 r773  
    4141  16 Jun 07 SHL Use DosQueryAppType not DosQAppType
    4242  02 Aug 07 SHL Sync with ARCITEM mods
     43  06 Aug 07 SHL Use BldFullPathName and BldQuotedFileName
     44  06 Aug 07 SHL Move BldQuotedFileName and BldQuotedFullPathNamehere
     45                to be near primary caller
    4346
    4447***********************************************************************/
     
    7679static PSZ pszSrcFile = __FILE__;
    7780
    78 #pragma alloc_text(ARCCNRS,ArcCnrWndProc,ArcObjWndProc,ArcClientWndProc)
    79 #pragma alloc_text(ARCCNRS,ArcTextProc,FillArcCnr,ArcFilter)
     81#pragma alloc_text(ARCCNRS,ArcCnrWndProc,ArcObjWndProc,ArcClientWndProc,BldQuotedFullPathName)
     82#pragma alloc_text(ARCCNRS,ArcTextProc,FillArcCnr,ArcFilter,BldQuotedFileName)
    8083#pragma alloc_text(ARCCNRS,ArcSort,ArcFrameWndProc,IsArcThere,ArcErrProc)
    8184#pragma alloc_text(STARTUP,StartArcCnr)
     85
     86/**
     87 * Build quoted full path name in callers buffer given
     88 * directory name and filename
     89 * @param pszPathName points to drive/directory if not NULL
     90 * @returns pointer to quoted path name in caller's buffer
     91 */
     92
     93PSZ 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 filename
     119 * @returns pointer to quoted file name in caller's buffer
     120 */
     121
     122PSZ 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}
    82137
    83138static MRESULT EXPENTRY ArcErrProc(HWND hwnd, ULONG msg, MPARAM mp1,
     
    85140{
    86141  ARCDUMP *ad;
     142  CHAR szQuotedArcName[CCHMAXPATH];
    87143
    88144  switch (msg) {
     
    158214      ad = WinQueryWindowPtr(hwnd, QWL_USER);
    159215      runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
    160               hwnd, NULL, NULL, "%s %s%s%s", ad->info->test,
    161               needs_quoting(ad->arcname) ? "\"" : NullStr,
    162               ad->arcname,
    163               needs_quoting(ad->arcname) ? "\"" : NullStr);
     216              hwnd, NULL, NULL,
     217              "%s %s",
     218              ad->info->test,
     219              BldQuotedFileName(szQuotedArcName, ad->arcname));
     220      // runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
     221      //              hwnd, NULL, NULL, "%s %s%s%s", ad->info->test,
     222              // needs_quoting(ad->arcname) ? "\"" : NullStr,
     223              // ad->arcname,
     224              // needs_quoting(ad->arcname) ? "\"" : NullStr);
    164225      break;
    165226    }
     
    383444static VOID EmptyArcCnr(HWND hwnd)
    384445{
    385 #if 0 // fixme to disable or to be configurable
     446#if 0 // fixme to be gone or to be configurable
    386447  {
    387448    int state = _heapchk();
     
    409470  HFILE newstdout;
    410471  CHAR s[CCHMAXPATH * 2], lonename[CCHMAXPATH + 2],
    411     *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[33];
     472       *nsize, *osize, *fdate, *fname, *p, *pp, arctemp[33];
    412473  BOOL gotstart;
    413474  BOOL gotend;
    414475  BOOL wasquote;
    415   BOOL nomove = FALSE;          // fixme to be gone?
     476  BOOL nomove = FALSE;                  // fixme to be gone?
    416477  INT highest = 0, x, counter = 0, numarcfiles = 0;
    417478  PARCITEM lastpai;
     
    484545      p = GetCmdSpec(TRUE);
    485546      runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT,
    486               hwndCnr,
    487               NULL,
    488               "DOS_BACKGROUND_EXECUTION=1",
    489               "%s /C %s %s%s%s > %s",
    490               p,
    491               info->list,
    492               needs_quoting(arcname) ? "\"" : NullStr,
    493               arcname,
    494               needs_quoting(arcname) ? "\"" : NullStr,
     547              hwndCnr, NULL, "DOS_BACKGROUND_EXECUTION=1",
     548              "%s /C %s %s >%s",
     549              p,                        // shell
     550              info->list,               // list command
     551              BldQuotedFileName(s, arcname),
    495552              arctemp);
     553      // runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT,
     554      //              hwndCnr,
     555      //              NULL,
     556      //              "DOS_BACKGROUND_EXECUTION=1",
     557      //              "%s /C %s %s%s%s > %s",
     558      //              p,
     559      //              info->list,
     560      //              needs_quoting(arcname) ? "\"" : NullStr,
     561      //              arcname,
     562      //              needs_quoting(arcname) ? "\"" : NullStr,
     563      //              arctemp);
    496564    }
    497565    else {
     
    519587          else {
    520588            runemf2(SEPARATE | INVISIBLE | FULLSCREEN | BACKGROUND | WAIT,
    521                     hwndCnr, NULL, NULL, "%s %s%s%s", info->list,
    522                     needs_quoting(arcname) ? "\"" : NullStr,
    523                     arcname,
    524                     needs_quoting(arcname) ? "\"" : NullStr);
     589                    hwndCnr, NULL, NULL,
     590                    "%s %s",
     591                    info->list,
     592                    BldQuotedFileName(s, arcname));
     593            // runemf2(SEPARATE | INVISIBLE | FULLSCREEN | BACKGROUND | WAIT,
     594            //      hwndCnr, NULL, NULL, "%s %s%s%s", info->list,
     595            //      needs_quoting(arcname) ? "\"" : NullStr,
     596            //      arcname,
     597            //      needs_quoting(arcname) ? "\"" : NullStr);
    525598            oldstdout = fileno(stdout);
    526599            DosError(FERR_DISABLEHARDERR);
     
    12151288  DIRCNRDATA *dcd;
    12161289  PSZ psz;
     1290  CHAR szQuotedArcName[CCHMAXPATH];
     1291  CHAR szQuotedMemberName[CCHMAXPATH];
    12171292
    12181293  switch (msg) {
     
    13121387          // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"%s %s %s\r[%s]",dcd->info->extract,dcd->arcname,membername,construct);
    13131388          runemf2(SEPARATE | WINDOWED | WAIT |
    1314                     (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    1315                     WAIT,
    1316                   dcd->hwndClient, construct, NULL, "%s %s%s%s %s%s%s",
     1389                    (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
     1390                  dcd->hwndClient, construct, NULL,
     1391                  "%s %s %s",
    13171392                  dcd->info->extract,
    1318                   needs_quoting(dcd->arcname) ? "\"" : NullStr,
    1319                   dcd->arcname,
    1320                   needs_quoting(dcd->arcname) ? "\"" : NullStr,
    1321                   needs_quoting(membername) ? "\"" : NullStr,
    1322                   membername,
    1323                   needs_quoting(membername) ? "\"" : NullStr);
    1324           if (*construct && construct[strlen(construct) - 1] != '\\')
    1325             strcat(construct, "\\");
    1326           strcat(construct, membername);
     1393                  BldQuotedFileName(szQuotedArcName, dcd->arcname),
     1394                  BldQuotedFileName(szQuotedMemberName, membername));
     1395          // runemf2(SEPARATE | WINDOWED | WAIT |
     1396          //        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
     1397          //        WAIT,
     1398          //      dcd->hwndClient, construct, NULL, "%s %s%s%s %s%s%s",
     1399          //      dcd->info->extract,
     1400          //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     1401          //      dcd->arcname,
     1402          //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     1403          //      needs_quoting(membername) ? "\"" : NullStr,
     1404          //      membername,
     1405          //      needs_quoting(membername) ? "\"" : NullStr);
     1406          BldFullPathName(construct, construct, membername);
     1407          // if (*construct && construct[strlen(construct) - 1] != '\\')
     1408          //   strcat(construct, "\\");
     1409          // strcat(construct, membername);
    13271410          if (IsFile(construct) != -1) {
    13281411            rename(construct, filename);
     
    14391522          return 0;
    14401523        }
    1441         runemf2(SEPARATE | WINDOWED |
    1442                   (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    1443                   WAIT,
    1444                 dcd->hwndClient, dcd->workdir, NULL, "%s %s%s%s %s%s%s",
     1524        runemf2(SEPARATE | WINDOWED | WAIT |
     1525                  (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
     1526                dcd->hwndClient, dcd->workdir, NULL,
     1527                "%s %s %s",
    14451528                dcd->info->exwdirs ? dcd->info->exwdirs :
    14461529                                     dcd->info->extract,
    1447                 needs_quoting(dcd->arcname) ? "\"" : NullStr,
    1448                 dcd->arcname,
    1449                 needs_quoting(dcd->arcname) ? "\"" : NullStr,
    1450                 needs_quoting(s) ? "\"" : NullStr,
    1451                 s,
    1452                 needs_quoting(s) ? "\"" : NullStr);
    1453 
    1454         // printf("%s %d runemf2 returned\n", __FILE__, __LINE__); fflush(stdout);      // 10 Mar 07 SHL
     1530                BldQuotedFileName(szQuotedArcName, dcd->arcname),
     1531                BldQuotedFileName(szQuotedMemberName, s));
     1532        // runemf2(SEPARATE | WINDOWED |
     1533        //        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
     1534        //        WAIT,
     1535        //      dcd->hwndClient, dcd->workdir, NULL, "%s %s%s%s %s%s%s",
     1536        //      dcd->info->exwdirs ? dcd->info->exwdirs :
     1537        //                           dcd->info->extract,
     1538        //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     1539        //      dcd->arcname,
     1540        //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     1541        //      needs_quoting(s) ? "\"" : NullStr,
     1542        //      s,
     1543        //      needs_quoting(s) ? "\"" : NullStr);
    14551544        if (!dcd->info->exwdirs) {
    14561545          p = s;
     
    15171606            strcpy(szBuffer, ad.command);
    15181607            strcat(szBuffer, " ");
    1519             if (needs_quoting(ad.arcname))
    1520               strcat(szBuffer, "\"");
    1521             strcat(szBuffer, ad.arcname);
    1522             if (needs_quoting(ad.arcname))
    1523               strcat(szBuffer, "\"");
    1524             p = &szBuffer[strlen(szBuffer)];
     1608
     1609            BldQuotedFileName(szBuffer + strlen(szBuffer), ad.arcname);
     1610            // if (needs_quoting(ad.arcname))
     1611            //   strcat(szBuffer, "\"");
     1612            // strcat(szBuffer, ad.arcname);
     1613            // if (needs_quoting(ad.arcname))
     1614            //   strcat(szBuffer, "\"");
     1615
     1616            p = &szBuffer[strlen(szBuffer)];    // Remeber where archiver name ends
     1617
    15251618            if (ad.mask.szMask) {
    15261619              strcat(szBuffer, " ");
    1527               if (needs_quoting(ad.mask.szMask))
    1528                 strcat(szBuffer, "\"");
    1529               strcat(szBuffer, ad.mask.szMask);
    1530               if (needs_quoting(ad.mask.szMask))
    1531                 strcat(szBuffer, "\"");
     1620
     1621              BldQuotedFileName(szBuffer + strlen(szBuffer), ad.mask.szMask);
     1622              // if (needs_quoting(ad.mask.szMask))
     1623              //        strcat(szBuffer, "\"");
     1624              // strcat(szBuffer, ad.mask.szMask);
     1625              // if (needs_quoting(ad.mask.szMask))
     1626              //        strcat(szBuffer, "\"");
    15321627            }
    15331628            strcat(szBuffer, " ");
    15341629            x = 0;
     1630
     1631            // Run commands avoiding command line overflow
    15351632            while (li->list[x]) {
    1536               if (needs_quoting(li->list[x]))
    1537                 strcat(szBuffer, "\"");
    1538               strcat(szBuffer, li->list[x]);
    1539               if (!IsFile(li->list[x])) {
    1540                 if (szBuffer[strlen(szBuffer) - 1] != '\\')
    1541                   strcat(szBuffer, "\\");
    1542                 strcat(szBuffer, "*");
    1543               }
    1544               if (needs_quoting(li->list[x]))
    1545                 strcat(szBuffer, "\"");
     1633
     1634              if (IsFile(li->list[x]))
     1635                BldQuotedFileName(szBuffer + strlen(szBuffer), li->list[x]);
     1636              else
     1637                BldQuotedFullPathName(szBuffer + strlen(szBuffer), li->list[x], "*");
     1638
     1639              // if (needs_quoting(li->list[x]))
     1640              //        strcat(szBuffer, "\"");
     1641              // strcat(szBuffer, li->list[x]);
     1642              // if (!IsFile(li->list[x])) {
     1643              //        if (szBuffer[strlen(szBuffer) - 1] != '\\')
     1644              //          strcat(szBuffer, "\\");
     1645              //        strcat(szBuffer, "*");
     1646              // }
     1647              // if (needs_quoting(li->list[x]))
     1648              //        strcat(szBuffer, "\"");
     1649
    15461650              x++;
    15471651              if (!li->list[x] || strlen(szBuffer) +
     
    15541658              }
    15551659              strcat(szBuffer, " ");
    1556             }
     1660            } // while
     1661
    15571662            PostMsg(dcd->hwndCnr, UM_RESCAN, MPFROMSHORT(1), MPVOID);
    15581663            Broadcast(WinQueryAnchorBlock(hwnd),
     
    15941699            if (!li->list || !li->list[0])
    15951700              break;
    1596             if (li->type == IDM_DELETE)
    1597               sprintf(cl, "%s %s%s%s", dcd->info->delete,
    1598                       (needs_quoting(dcd->arcname)) ? "\"" : NullStr,
    1599                       dcd->arcname,
    1600                       (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
    1601             else
    1602               sprintf(cl, "%s %s%s%s", dcd->info->create,
    1603                       (needs_quoting(dcd->arcname)) ? "\"" : NullStr,
    1604                       dcd->arcname,
    1605                       (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
     1701            strcpy(cl, li->type == IDM_DELETE ?
     1702                         dcd->info->delete :
     1703                         dcd->info->create);
     1704            strcat(cl, " ");
     1705            BldQuotedFileName(cl + strlen(cl), dcd->arcname);
     1706            // if (li->type == IDM_DELETE)
     1707            //   sprintf(cl, "%s %s%s%s", dcd->info->delete,
     1708            //        (needs_quoting(dcd->arcname)) ? "\"" : NullStr,
     1709            //        dcd->arcname,
     1710            //        (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
     1711            // else
     1712            //   sprintf(cl, "%s %s%s%s", dcd->info->create,
     1713            //        (needs_quoting(dcd->arcname)) ? "\"" : NullStr,
     1714            //        dcd->arcname,
     1715            //        (needs_quoting(dcd->arcname)) ? "\"" : NullStr);
    16061716            endofit = &cl[strlen(cl)];
    16071717            z = 0;
     
    16101720                   strlen(cl) + strlen(li->list[x]) < 999; x++) {
    16111721                strcat(cl, " ");
    1612                 if (needs_quoting(li->list[x]))
    1613                   strcat(cl, "\"");
    1614                 strcat(cl, li->list[x]);
    1615                 if (needs_quoting(li->list[x]))
    1616                   strcat(cl, "\"");
     1722                BldQuotedFileName(cl + strlen(cl), li->list[x]);
     1723                // if (needs_quoting(li->list[x]))
     1724                //   strcat(cl, "\"");
     1725                // strcat(cl, li->list[x]);
     1726                // if (needs_quoting(li->list[x]))
     1727                //   strcat(cl, "\"");
    16171728              }
    16181729              z = x;
    1619               runemf2(SEPARATE | WINDOWED |
    1620                         (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    1621                         WAIT,
     1730              runemf2(SEPARATE | WINDOWED | WAIT |
     1731                        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    16221732                      hwnd, NullStr, NULL, "%s", cl);
    16231733              *endofit = 0;
     
    16701780
    16711781              for (x = 0; li->list[x]; x++) {
    1672                 sprintf(fullname, "%s%s%s",
    1673                         li->targetpath,
    1674                         (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?
    1675                         NullStr : "\\", li->list[x]);
     1782                BldFullPathName(fullname, li->targetpath, li->list[x]);
     1783                // sprintf(fullname, "%s%s%s",
     1784                //      li->targetpath,
     1785                //      (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?
     1786                //      NullStr : "\\", li->list[x]);
    16761787                if (IsFile(fullname) != -1) {
    16771788                  AddToList(li->list[x], &exfiles, &numfiles, &numalloc);
     
    17081819            if (!li->list || !li->list[0])
    17091820              break;
    1710             sprintf(cl, "%s %s%s%s", (li->type == IDM_EXTRACT ||
    1711                                       ((li->type == IDM_VIEW
    1712                                         || li->type == IDM_VIEWTEXT
    1713                                         || li->type == IDM_VIEWBINARY
    1714                                         || li->type == IDM_VIEWARCHIVE
    1715                                         || li->type == IDM_PRINT
    1716                                         || li->type == IDM_EDIT
    1717                                         || li->type == IDM_EDITTEXT
    1718                                         || li->type == IDM_EDITBINARY
    1719                                         && li->type == IDM_MCIPLAY)
    1720                                        && !li->info->exwdirs)) ? li->info->
    1721                     extract : li->info->exwdirs,
    1722                     needs_quoting(li->arcname) ? "\"" : NullStr,
    1723                     li->arcname,
    1724                     needs_quoting(li->arcname) ? "\"" : NullStr);
     1821            strcpy(cl,
     1822                   (li->type == IDM_EXTRACT ||
     1823                    ((li->type == IDM_VIEW ||
     1824                      li->type == IDM_VIEWTEXT ||
     1825                      li->type == IDM_VIEWBINARY ||
     1826                      li->type == IDM_VIEWARCHIVE ||
     1827                      li->type == IDM_PRINT ||
     1828                      li->type == IDM_EDIT ||
     1829                      li->type == IDM_EDITTEXT ||
     1830                      (li->type == IDM_EDITBINARY &&
     1831                       li->type == IDM_MCIPLAY)) &&
     1832                     !li->info->exwdirs)) ?
     1833                     li->info->extract :
     1834                     li->info->exwdirs);
     1835             strcat(cl, " ");
     1836             BldQuotedFileName(cl + strlen(cl), li->arcname);
     1837            // sprintf(cl, "%s %s%s%s", (li->type == IDM_EXTRACT ||
     1838            //                        ((li->type == IDM_VIEW
     1839            //                          || li->type == IDM_VIEWTEXT
     1840            //                          || li->type == IDM_VIEWBINARY
     1841            //                          || li->type == IDM_VIEWARCHIVE
     1842            //                          || li->type == IDM_PRINT
     1843            //                          || li->type == IDM_EDIT
     1844            //                          || li->type == IDM_EDITTEXT
     1845            //                          || li->type == IDM_EDITBINARY
     1846            //                          && li->type == IDM_MCIPLAY)
     1847            //                         && !li->info->exwdirs)) ? li->info->
     1848            //      extract : li->info->exwdirs,
     1849            //      needs_quoting(li->arcname) ? "\"" : NullStr,
     1850            //      li->arcname,
     1851            //      needs_quoting(li->arcname) ? "\"" : NullStr);
    17251852            endofit = &cl[strlen(cl)];
    17261853            z = 0;
     
    17291856                   strlen(cl) + strlen(li->list[x]) < 999; x++) {
    17301857                strcat(cl, " ");
    1731                 if (needs_quoting(li->list[x]))
    1732                   strcat(cl, "\"");
    1733                 strcat(cl, li->list[x]);
    1734                 if (needs_quoting(li->list[x]))
    1735                   strcat(cl, "\"");
     1858                BldQuotedFileName(cl + strlen(cl), li->list[x]);
     1859                // if (needs_quoting(li->list[x]))
     1860                //   strcat(cl, "\"");
     1861                // strcat(cl, li->list[x]);
     1862                // if (needs_quoting(li->list[x]))
     1863                //   strcat(cl, "\"");
    17361864                ptr = li->list[x];
    17371865                while (*ptr) {
     
    18311959                  }
    18321960                }
    1833                 sprintf(cl, "%s%s%s", li->targetpath,
    1834                         (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?
    1835                         NullStr : "\\", li->list[x]);
     1961                BldFullPathName(cl, li->targetpath, li->list[x]);
     1962                // sprintf(cl, "%s%s%s", li->targetpath,
     1963                //      (li->targetpath[strlen(li->targetpath) - 1] == '\\') ?
     1964                //      NullStr : "\\", li->list[x]);
    18361965                temp = li->list[x];
    18371966                li->list[x] = xstrdup(cl, pszSrcFile, __LINE__);
     
    19532082                p++;
    19542083              }
    1955               sprintf(fullname, "%s%s%s", dcd->directory,
    1956                       (dcd->directory[strlen(dcd->directory) - 1] == '\\') ?
    1957                       NullStr : "\\", li->list[x]);
     2084              BldFullPathName(fullname, dcd->directory, li->list[x]);
     2085              // sprintf(fullname, "%s%s%s", dcd->directory,
     2086              //              (dcd->directory[strlen(dcd->directory) - 1] == '\\') ?
     2087              //              NullStr : "\\", li->list[x]);
    19582088              if (IsFile(fullname) != -1)
    19592089                if (AddToList(fullname, &list2, &numfiles, &numalloced))
     
    19642094                  p++;
    19652095                  if (*p) {
    1966                     sprintf(fullname, "%s%s%s", dcd->directory,
    1967                             (dcd->directory[strlen(dcd->directory) - 1] ==
    1968                                '\\') ? NullStr : "\\",
    1969                             p);
     2096                    BldFullPathName(fullname, dcd->directory, p);
     2097                    // sprintf(fullname, "%s%s%s", dcd->directory,
     2098                    //      (dcd->directory[strlen(dcd->directory) - 1] ==
     2099                    //         '\\') ? NullStr : "\\",
     2100                    //      p);
    19702101                    if (IsFile(fullname) != -1)
    19712102                      if (AddToList(fullname, &list2, &numfiles, &numalloced))
     
    20292160{
    20302161  DIRCNRDATA *dcd = INSTDATA(hwnd);
     2162  CHAR szQuotedArcName[CCHMAXPATH];
    20312163
    20322164  switch (msg) {
     
    28052937          runemf2(SEPARATE | WINDOWED |
    28062938                    (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    2807                   hwnd, dcd->directory, NULL, "%s %s%s%s",
     2939                  hwnd, dcd->directory, NULL, "%s %s",
    28082940                  dcd->info->extract,
    2809                   needs_quoting(dcd->arcname) ? "\"" : NullStr,
    2810                   dcd->arcname,
    2811                   needs_quoting(dcd->arcname) ? "\"" : NullStr);
     2941                  BldQuotedFileName(szQuotedArcName, dcd->arcname));
     2942          // runemf2(SEPARATE | WINDOWED |
     2943          //        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
     2944          //      hwnd, dcd->directory, NULL, "%s %s%s%s",
     2945          //      dcd->info->extract,
     2946          //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     2947          //      dcd->arcname,
     2948          //      needs_quoting(dcd->arcname) ? "\"" : NullStr);
    28122949        if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTEXIT)
    28132950          PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
     
    28192956          runemf2(SEPARATE | WINDOWED |
    28202957                    (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    2821                   hwnd, dcd->directory, NULL, "%s %s%s%s",
     2958                  hwnd, dcd->directory, NULL,
     2959                  "%s %s",
    28222960                  dcd->info->exwdirs,
    2823                   needs_quoting(dcd->arcname) ? "\"" : NullStr,
    2824                   dcd->arcname,
    2825                   needs_quoting(dcd->arcname) ? "\"" : NullStr);
     2961                  BldQuotedFileName(szQuotedArcName, dcd->arcname));
     2962          // runemf2(SEPARATE | WINDOWED |
     2963          //        (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
     2964          //      hwnd, dcd->directory, NULL, "%s %s%s%s",
     2965          //      dcd->info->exwdirs,
     2966          //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     2967          //      dcd->arcname,
     2968          //      needs_quoting(dcd->arcname) ? "\"" : NullStr);
    28262969        if (SHORT1FROMMP(mp1) == IDM_ARCEXTRACTWDIRSEXIT)
    28272970          PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
     
    28913034        if (dcd->info->test)
    28923035          runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
    2893                   hwnd, NULL, NULL, "%s %s%s%s", dcd->info->test,
    2894                   needs_quoting(dcd->arcname) ? "\"" : NullStr,
    2895                   dcd->arcname,
    2896                   needs_quoting(dcd->arcname) ? "\"" : NullStr);
     3036                  hwnd, NULL, NULL,
     3037                  "%s %s",dcd->info->test,
     3038                  BldQuotedFileName(szQuotedArcName, dcd->arcname));
     3039          // runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
     3040          //      hwnd, NULL, NULL, "%s %s%s%s",dcd->info->test,
     3041          //      needs_quoting(dcd->arcname) ? "\"" : NullStr,
     3042          //      dcd->arcname,
     3043          //      needs_quoting(dcd->arcname) ? "\"" : NullStr);
    28973044        break;
    28983045
     
    29263073
    29273074              for (x = 0; li->list && li->list[x]; x++) {
    2928                 sprintf(s, "%s%s%s", dcd->workdir,
    2929                         (dcd->workdir[strlen(dcd->workdir) - 1] == '\\') ?
    2930                         NullStr : "\\", li->list[x]);
     3075                BldFullPathName(s, dcd->workdir, li->list[x]);
     3076                // sprintf(s, "%s%s%s", dcd->workdir,
     3077                //      (dcd->workdir[strlen(dcd->workdir) - 1] == '\\') ?
     3078                //      NullStr : "\\", li->list[x]);
    29313079                if (IsFile(s) != 1) {
    29323080                  free(li->list[x]);
     
    30483196        if (mp2) {
    30493197
    3050           PDRAGITEM pDItem;     /* Pointer to DRAGITEM */
    3051           PDRAGINFO pDInfo;     /* Pointer to DRAGINFO */
     3198          PDRAGITEM pDItem;             /* Pointer to DRAGITEM */
     3199          PDRAGINFO pDInfo;             /* Pointer to DRAGINFO */
    30523200          PARCITEM pci;
    30533201
     
    30733221                           DRM_OS2FILE, /* mechanisms and data */
    30743222                           NULL) && !(pDItem->fsControl & DC_PREPARE)) {
    3075             DrgFreeDraginfo(pDInfo);    /* Free DRAGINFO         */
     3223            DrgFreeDraginfo(pDInfo);    /* Free DRAGINFO */
    30763224            return MRFROM2SHORT(DOR_DROP,       /* Return okay to drop */
    30773225                                fCopyDefault ? DO_COPY : DO_MOVE);
Note: See TracChangeset for help on using the changeset viewer.