Changeset 888 for trunk/dll/worker.c


Ignore:
Timestamp:
Dec 22, 2007, 11:02:11 PM (18 years ago)
Author:
Gregg Young
Message:

runemf2 now quotes executable strings if needed (Ticket 180); it also reports where it was called from on errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r847 r888  
    412412                  if (!runemf2(SEPARATE | WINDOWED |
    413413                               fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED),
    414                                HWND_DESKTOP, ex.extractdir, NULL,
     414                               HWND_DESKTOP, pszSrcFile, __LINE__, ex.extractdir, NULL,
    415415                               "%s %s %s%s%s",
    416416                               ex.command,
     
    857857                  else {
    858858                    runemf2(SEPARATE,
    859                             HWND_DESKTOP, NULL, NULL,
     859                            HWND_DESKTOP, pszSrcFile, __LINE__,
     860                            NULL, NULL,
    860861                            "%s %s %s",
    861862                            dircompare,
    862863                            BldQuotedFileName(szQuotedDirName, wk->li->targetpath),
    863864                            BldQuotedFileName(szQuotedFileName, wk->li->list[x]));
    864                     // CHAR d1[] = "\"";
    865                     // CHAR d2[] = "\"";
    866                     // if (!needs_quoting(wk->li->targetpath))
    867                     //   *d1 = 0;
    868                     // if (!needs_quoting(wk->li->list[x]))
    869                     //   *d2 = 0;
    870                     // runemf2(SEPARATE,
    871                     //      HWND_DESKTOP, NULL, NULL,
    872                     //      "%s %s%s%s %s%s%s",
    873                     //      dircompare,
    874                     //      d1, wk->li->targetpath, d1,
    875                     //      d2, wk->li->list[x], d2);
    876865                  }
    877866                }
     
    884873                  ExecOnList(wk->hwndFrame,
    885874                             compare,
    886                              WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL);
     875                             WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
     876                             pszSrcFile, __LINE__);
    887877                }
    888878                else {
     
    10291019                       "%a",
    10301020                       WINDOWED | SEPARATE | PROMPT,
    1031                        NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT));
     1021                       NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT),
     1022                       pszSrcFile, __LINE__);
    10321023            break;
    10331024
     
    10811072                strcat(szBuffer, " ");
    10821073                BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->arcname);
    1083                 // if (needs_quoting(wk->li->arcname))
    1084                 //   strcat(szBuffer, "\"");
    1085                 // strcat(szBuffer, wk->li->arcname);
    1086                 // if (needs_quoting(wk->li->arcname))
    1087                 //   strcat(szBuffer, "\"");
    10881074              }
    10891075              else {
     
    11061092                }
    11071093                BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
    1108                 // if (needs_quoting(wk->li->list[x]))
    1109                 //   strcat(szBuffer, "\"");
    1110                 // strcat(szBuffer, wk->li->list[x]);
    1111                 // if (needs_quoting(wk->li->list[x]))
    1112                 //   strcat(szBuffer, "\"");
    11131094                x++;
    11141095                if (!wk->li->list[x] || strlen(szBuffer) +
    11151096                    strlen(wk->li->list[x]) + 5 > 1024) {
    11161097                  runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
    1117                           HWND_DESKTOP,
     1098                          HWND_DESKTOP, pszSrcFile, __LINE__,
    11181099                          (wk->li->type == IDM_FAKEEXTRACT ||
    11191100                           wk->li->type == IDM_FAKEEXTRACTM) ?
     
    12351216              strcat(szBuffer, " ");
    12361217              BldQuotedFileName(szBuffer + strlen(szBuffer), ad.arcname);
    1237               // if (needs_quoting(ad.arcname))
    1238               //        strcat(szBuffer, "\"");
    1239               // strcat(szBuffer, ad.arcname);
    1240               // if (needs_quoting(ad.arcname))
    1241               //        strcat(szBuffer, "\"");
    12421218              p = &szBuffer[strlen(szBuffer)];
    12431219              if (ad.mask.szMask) {
     
    12491225              while (wk->li->list[x]) {
    12501226                FILESTATUS3 fsa;
    1251                 // BOOL spaces;
    1252                 // if (needs_quoting(wk->li->list[x])) {
    1253                 //   spaces = TRUE;
    1254                 //   strcat(szBuffer, "\"");
    1255                 // }
    1256                 // else
    1257                 //   spaces = FALSE;
    1258                 // strcat(szBuffer, wk->li->list[x]);
    12591227                memset(&fsa, 0, sizeof(FILESTATUS3));
    12601228                DosError(FERR_DISABLEHARDERR);
     
    12641232                if (fsa.attrFile & FILE_DIRECTORY) {
    12651233                  BldQuotedFullPathName(szBuffer + strlen(szBuffer), wk->li->list[x], "*");
    1266                   // if (szBuffer[strlen(szBuffer) - 1] != '\\')
    1267                   //   strcat(szBuffer, "\\");
    1268                   // strcat(szBuffer, "*");
    12691234                }
    12701235                else
    12711236                  BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
    1272                 // if (spaces)
    1273                 //   strcat(szBuffer, "\"");
    12741237                x++;
    12751238                if (!wk->li->list[x] ||
     
    12771240                  runemf2(SEPARATE | WINDOWED | WAIT |
    12781241                          (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)),
    1279                           HWND_DESKTOP, NULL, NULL,
     1242                          HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
    12801243                          "%s", szBuffer);
    12811244                  DosSleep(1);
     
    13051268              ExecOnList((HWND) 0,
    13061269                         binview,
    1307                          WINDOWED | SEPARATE, NULL, wk->li->list, NULL);
     1270                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1271                         pszSrcFile, __LINE__);
    13081272              break;
    13091273            }
     
    13151279                         WINDOWED | SEPARATE |
    13161280                         ((fViewChild) ? CHILD : 0),
    1317                          NULL, wk->li->list, NULL);
     1281                         NULL, wk->li->list, NULL,
     1282                         pszSrcFile, __LINE__);
    13181283            else {
    13191284
     
    13491314              ExecOnList((HWND) 0,
    13501315                         bined,
    1351                          WINDOWED | SEPARATE, NULL, wk->li->list, NULL);
     1316                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1317                         pszSrcFile, __LINE__);
    13521318              break;
    13531319            }
     
    13581324              ExecOnList((HWND) 0,
    13591325                         editor,
    1360                          WINDOWED | SEPARATE, NULL, wk->li->list, NULL);
     1326                         WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
     1327                         pszSrcFile, __LINE__);
    13611328            else {
    13621329
Note: See TracChangeset for help on using the changeset viewer.