Hi Rob,<br><br>  With your fix, it doesn't segfault now.<br>But does it matter, to give the proper option name in error message. If yes, then the <br>fix fails in that. <br>e.g. when running <b>./toybox touch -d 12 -r f2 f1</b> it throws the error message as<br>
<b>touch: No 'r' with 't'</b>.<br><br>I feel the error message is not explanatory here. it should give the proper option names in here.<br>my patch had this fix.<br><br>Pls give your inputs.<br><br>regards,<br>
Ashwini<br><br><div class="gmail_quote">On Fri, Dec 28, 2012 at 6:21 AM, Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 12/27/2012 11:06:37 AM, Felix Janda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When trying to implement the remaining options for "pwd" I could also test<br>
toybox's group option handling.<br>
<br>
The option string I wanted to use is: ">0LP[!LP]"<br>
(It's the same for "LP[!LP]".)<br>
<br>
With the current argparsing I get a segfault for "pwd -L -P". When enabling<br>
TOYBOX_DEBUG it says "pwd: trailing [!LP]". On the other hand when using<br>
Ashwini's suggestion with disabled TOYBOX_DEBUG everthing seems to work,<br>
whereas with enabled TOYBOX_DEBUG I get the same error message as before.<br>
</blockquote>
<br></div></div>
Ok, this I can reproduce.  Hmmm...<br>
<br>
Ah. You're right, the test was wrong. (It got the condition right, but couldn't work out the correct error message due to & vs &&.)<br>
<br>
Testing for NULL just hid the problem, it didn't fix it. I checked in a fix.<br>
<br>
Thanks,<br>
<br>
Rob</blockquote></div><br>