@@ -315,6 +315,7 @@ namespace
315
315
{ L" wiclossless" , L" wic-lossless" },
316
316
{ L" wicmulti" , L" wic-multiframe" },
317
317
{ L" x2bias" , L" x2-bias" },
318
+ { nullptr , nullptr }
318
319
};
319
320
320
321
#define DEFFMT (fmt ) { L## #fmt, DXGI_FORMAT_ ## fmt }
@@ -1292,6 +1293,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1292
1293
if (allowOpts && ((' -' == pArg[0 ]) || (' /' == pArg[0 ])))
1293
1294
{
1294
1295
uint64_t dwOption = 0 ;
1296
+ PWSTR pValue = nullptr ;
1295
1297
1296
1298
if ((' -' == pArg[0 ]) && (' -' == pArg[1 ]))
1297
1299
{
@@ -1304,6 +1306,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1304
1306
else
1305
1307
{
1306
1308
pArg += 2 ;
1309
+
1310
+ for (pValue = pArg; *pValue && (' :' != *pValue) && (' =' != *pValue); ++pValue);
1311
+
1312
+ if (*pValue)
1313
+ *pValue++ = 0 ;
1314
+
1307
1315
dwOption = LookupByName (pArg, g_pOptionsLong);
1308
1316
1309
1317
if (dwOption == OPT_VERSION)
@@ -1321,6 +1329,12 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1321
1329
else
1322
1330
{
1323
1331
pArg++;
1332
+
1333
+ for (pValue = pArg; *pValue && (' :' != *pValue) && (' =' != *pValue); ++pValue);
1334
+
1335
+ if (*pValue)
1336
+ *pValue++ = 0 ;
1337
+
1324
1338
dwOption = LookupByName (pArg, g_pOptions);
1325
1339
1326
1340
if (!dwOption)
@@ -1348,13 +1362,6 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1348
1362
return 1 ;
1349
1363
}
1350
1364
1351
- PWSTR pValue = pArg;
1352
-
1353
- for (; *pValue && (' :' != *pValue); ++pValue);
1354
-
1355
- if (*pValue)
1356
- *pValue++ = 0 ;
1357
-
1358
1365
if (dwOptions & (uint64_t (1 ) << dwOption))
1359
1366
{
1360
1367
wprintf (L" ERROR: Duplicate option: `%ls`\n\n " , pArg);
0 commit comments