<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Alexandre Julliard wrote:
<blockquote cite="mid:87vdi7le8e.fsf@wine.dyndns.org" type="cite">
  <pre wrap="">Ilya Shpigor <a class="moz-txt-link-rfc2396E" href="mailto:shpigor@etersoft.ru">&lt;shpigor@etersoft.ru&gt;</a> writes:

  </pre>
  <blockquote type="cite">
    <pre wrap="">+    /* Parse options */
+    for(i = 0; i &lt; argc; i++)
+    {
+        if (argv[i][0] == '/')
+        {
+            for(j = 0; j &lt; sizeof(sFlags) / sizeof(sFlags[0]); j++)
+                if (!strcmpiW(argv[i], sFlags[j].wFlag))
+                {
+                    comp |= sFlags[j].nFlag;
+                    goto next;
+                }
+        }
+        next:
+            continue;
+    }
+
+    if ((comp &amp; CMD_FLAGS) == EFLAGC) /* copy file */
+    {
+        WINE_FIXME("/C not implemented\n");
+    } else if ((comp &amp; CMD_FLAGS) == EFLAGD) /* display CAB archive */
+    {
+        WINE_FIXME("/D not implemented\n");
+    } else if ((comp &amp; CMD_FLAGS) == EFLAGE) /* extract CAB archive */
+    {
+        WINE_FIXME("/E not implemented\n");
+    } else if ((comp &amp; CMD_FLAGS) == 0) /* expand mode */
+    {
+        WINE_FIXME("Expand mode not implemented\n");
+    }
    </pre>
  </blockquote>
  <pre wrap=""><!---->
That parsing approach is not really appropriate here, the options are
not just a bunch of flags, there are options with arguments, mutually
exclusive modes, etc. Some sort of switch() statement would be more
natural.
  </pre>
</blockquote>
<br>
Actually they are just a bunch of flags with exception for /L which
takes an argument - this is covered by Ilya's third patch, and /C, /D
and /E which are mutually exclusive "mode" switches - this is covered
by CMD_FLAGS bitmask. At least Vista's extrac32 don't care for
inappropriate flags, e.g.:<br>
<br>
&gt; md temp<br>
&gt; md temp2<br>
&gt; echo "test" &gt; test<br>
&gt; extrac32 /Y /A /L temp2 /C test temp|more<br>
Microsoft (R) Cabinet Extraction Tool - Version 6.0.6001.18000<br>
Copyright (c) Microsoft Corporation. All rights reserved..<br>
Extracting test -&gt; temp\test<br>
<br>
And indeed there is a copied file in "temp" directory despite erroneous
"/A" and "/L path" flags.<br>
<br>
</body>
</html>