Changeset 773 for trunk/dll/worker.c
- Timestamp:
- Aug 7, 2007, 11:23:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/worker.c
r771 r773 20 20 21 Apr 07 GKY Find FM2Utils by path or utils directory 21 21 16 Jun 07 SHL Update for OpenWatcom 22 07 Aug 07 SHL Use BldQuotedFileName 22 23 23 24 ***********************************************************************/ … … 110 111 VOID Action(VOID * args) 111 112 { 112 WORKER *wk = (WORKER *) 113 WORKER *wk = (WORKER *)args; 113 114 HAB hab2; 114 115 HMQ hmq2; … … 116 117 INT numfiles = 0, numalloc = 0, plen = 0; 117 118 CHAR *p, *pp; 119 CHAR szQuotedDirName[CCHMAXPATH]; 120 CHAR szQuotedFileName[CCHMAXPATH]; 118 121 119 122 if (wk) { … … 407 410 maskspaces = TRUE; 408 411 if (!runemf2(SEPARATE | WINDOWED | 409 ((fArcStuffVisible) ? 0 : 410 (BACKGROUND | MINIMIZED)), 411 HWND_DESKTOP, 412 ex.extractdir, 413 NULL, 412 fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED), 413 HWND_DESKTOP, ex.extractdir, NULL, 414 414 "%s %s %s%s%s", 415 415 ex.command, 416 416 ex.arcname, 417 (maskspaces)? "\"" : NullStr,418 (*ex.masks)? ex.masks : "*",419 (maskspaces)? "\"" : NullStr) &&417 maskspaces ? "\"" : NullStr, 418 *ex.masks ? ex.masks : "*", 419 maskspaces ? "\"" : NullStr) && 420 420 !stricmp(ex.extractdir, wk->directory)) { 421 421 if (WinIsWindow(hab2, wk->hwndCnr)) … … 855 855 MPFROMP(wk->li->list[x])); 856 856 else { 857 CHAR d1[] = "\"";858 CHAR d2[] = "\"";859 860 if (!needs_quoting(wk->li->targetpath))861 *d1 = 0;862 if (!needs_quoting(wk->li->list[x]))863 *d2 = 0;864 857 runemf2(SEPARATE, 865 HWND_DESKTOP, 866 NULL, 867 NULL, 868 "%s %s%s%s %s%s%s", 858 HWND_DESKTOP, NULL, NULL, 859 "%s %s %s", 869 860 dircompare, 870 d1, 871 wk->li->targetpath, d1, d2, wk->li->list[x], d2); 861 BldQuotedFileName(szQuotedDirName, wk->li->targetpath), 862 BldQuotedFileName(szQuotedFileName, wk->li->list[x])); 863 // CHAR d1[] = "\""; 864 // CHAR d2[] = "\""; 865 // if (!needs_quoting(wk->li->targetpath)) 866 // *d1 = 0; 867 // if (!needs_quoting(wk->li->list[x])) 868 // *d2 = 0; 869 // runemf2(SEPARATE, 870 // HWND_DESKTOP, NULL, NULL, 871 // "%s %s%s%s %s%s%s", 872 // dircompare, 873 // d1, wk->li->targetpath, d1, 874 // d2, wk->li->list[x], d2); 872 875 } 873 876 } … … 1076 1079 wk->li->info->exwdirs : wk->li->info->extract); 1077 1080 strcat(szBuffer, " "); 1078 if (needs_quoting(wk->li->arcname)) 1079 strcat(szBuffer, "\""); 1080 strcat(szBuffer, wk->li->arcname); 1081 if (needs_quoting(wk->li->arcname)) 1082 strcat(szBuffer, "\""); 1081 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->arcname); 1082 // if (needs_quoting(wk->li->arcname)) 1083 // strcat(szBuffer, "\""); 1084 // strcat(szBuffer, wk->li->arcname); 1085 // if (needs_quoting(wk->li->arcname)) 1086 // strcat(szBuffer, "\""); 1083 1087 } 1084 1088 else { … … 1100 1104 pp++; 1101 1105 } 1102 if (needs_quoting(wk->li->list[x])) 1103 strcat(szBuffer, "\""); 1104 strcat(szBuffer, wk->li->list[x]); 1105 if (needs_quoting(wk->li->list[x])) 1106 strcat(szBuffer, "\""); 1106 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]); 1107 // if (needs_quoting(wk->li->list[x])) 1108 // strcat(szBuffer, "\""); 1109 // strcat(szBuffer, wk->li->list[x]); 1110 // if (needs_quoting(wk->li->list[x])) 1111 // strcat(szBuffer, "\""); 1107 1112 x++; 1108 1113 if (!wk->li->list[x] || strlen(szBuffer) + … … 1110 1115 runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT, 1111 1116 HWND_DESKTOP, 1112 ((wk->li->type == IDM_FAKEEXTRACT || 1113 wk->li->type == IDM_FAKEEXTRACTM) ? 1114 wk->li->targetpath : NULL), NULL, "%s", szBuffer); 1117 (wk->li->type == IDM_FAKEEXTRACT || 1118 wk->li->type == IDM_FAKEEXTRACTM) ? 1119 wk->li->targetpath : NULL, 1120 NULL, 1121 "%s", szBuffer); 1115 1122 DosSleep(1); 1116 1123 *p = 0; … … 1226 1233 strcpy(szBuffer, ad.command); 1227 1234 strcat(szBuffer, " "); 1228 if (needs_quoting(ad.arcname)) 1229 strcat(szBuffer, "\""); 1230 strcat(szBuffer, ad.arcname); 1231 if (needs_quoting(ad.arcname)) 1232 strcat(szBuffer, "\""); 1235 BldQuotedFileName(szBuffer + strlen(szBuffer), ad.arcname); 1236 // if (needs_quoting(ad.arcname)) 1237 // strcat(szBuffer, "\""); 1238 // strcat(szBuffer, ad.arcname); 1239 // if (needs_quoting(ad.arcname)) 1240 // strcat(szBuffer, "\""); 1233 1241 p = &szBuffer[strlen(szBuffer)]; 1234 1242 if (ad.mask.szMask) { … … 1239 1247 x = 0; 1240 1248 while (wk->li->list[x]) { 1241 1242 1249 FILESTATUS3 fsa; 1243 BOOL spaces; 1244 1245 if (needs_quoting(wk->li->list[x])) { 1246 spaces = TRUE; 1247 strcat(szBuffer, "\""); 1248 } 1249 else 1250 spaces = FALSE; 1251 strcat(szBuffer, wk->li->list[x]); 1250 // BOOL spaces; 1251 // if (needs_quoting(wk->li->list[x])) { 1252 // spaces = TRUE; 1253 // strcat(szBuffer, "\""); 1254 // } 1255 // else 1256 // spaces = FALSE; 1257 // strcat(szBuffer, wk->li->list[x]); 1252 1258 memset(&fsa, 0, sizeof(FILESTATUS3)); 1253 1259 DosError(FERR_DISABLEHARDERR); … … 1256 1262 &fsa, (ULONG) sizeof(FILESTATUS3)); 1257 1263 if (fsa.attrFile & FILE_DIRECTORY) { 1258 if (szBuffer[strlen(szBuffer) - 1] != '\\') 1259 strcat(szBuffer, "\\"); 1260 strcat(szBuffer, "*"); 1261 } 1262 if (spaces) 1263 strcat(szBuffer, "\""); 1264 BldQuotedFullPathName(szBuffer + strlen(szBuffer), wk->li->list[x], "*"); 1265 // if (szBuffer[strlen(szBuffer) - 1] != '\\') 1266 // strcat(szBuffer, "\\"); 1267 // strcat(szBuffer, "*"); 1268 } 1269 else 1270 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]); 1271 // if (spaces) 1272 // strcat(szBuffer, "\""); 1264 1273 x++; 1265 1274 if (!wk->li->list[x] || 1266 1275 strlen(szBuffer) + strlen(wk->li->list[x]) + 5 > 1024) { 1267 runemf2(SEPARATE | WINDOWED | 1268 ( (fArcStuffVisible) ? 0 :1269 (BACKGROUND | MINIMIZED)) |1270 WAIT, HWND_DESKTOP, NULL, NULL,"%s", szBuffer);1276 runemf2(SEPARATE | WINDOWED | WAIT | 1277 (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)), 1278 HWND_DESKTOP, NULL, NULL, 1279 "%s", szBuffer); 1271 1280 DosSleep(1); 1272 1281 *p = 0;
Note:
See TracChangeset
for help on using the changeset viewer.