<div><div style="line-height: 21px;">OkŁˇIt's my pleasure :-)</div><div style="line-height: 21px;"><br></div><div style="line-height: 21px;"><br></div><div style="line-height: 21px;">Thanks,</div><div style="line-height: 21px;">Zhe</div></div><div><includetail><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Liu Yuan"<namei.unix@gmail.com>;</div><div><b>Date: </b> Mon, Mar 18, 2013 01:12 PM</div><div><b>To: </b> "ChenZhe"<cz@de3eb.cn>; <wbr></div><div><b>Cc: </b> "MORITA Kazutaka"<morita.kazutaka@gmail.com>; "ChenZhe"<chenzhe@xinnet.com>; "sheepdog"<sheepdog@lists.wpkg.org>; <wbr></div><div><b>Subject: </b> Re: [sheepdog] [PATCH] collie: correct command-line options parser</div></div><div> </div>On 03/18/2013 01:08 PM, Liu Yuan wrote:<br>> On 03/18/2013 08:43 AM, MORITA Kazutaka wrote:<br>>>>>>> +       if (flags & SUBCMD_FLAG_NEED_THIRD_ARG && optind <= 3)<br>>>>>>>            subcommand_usage(argv[1], argv[2], EXIT_USAGE);<br>>>>>>>  <br>>>>>>>         return command_fn(argc, argv);<br>>>>>>><br>>>>><br>>>>> Kazutaka, this bug does exist (even with '-p 7001'), but 'optind <= 3'<br>>>>> looks quite suspicious to me, could you review it?<br>>> It is not a good idea to increase optind before getopt_long.  The real<br>>> problem is that we specify the thrid arguemnt as argv[3] in<br>>> cluster_recover.  It should be argv[optind].<br>> <br>> ChenZhe, could you prepare a new patch v2 based on this comment?<br>> <br><br>Hi ChenZhe,<br><br>    There are other places use the wrong argv[3] too, such as<br>vdi_cache() and debug_trace(). You'd better correct them too in V2.<br><br>Thanks,<br>Yuan<br><br><br></div></includetail></div>