[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: unzip applet not working ?
From:       Doug Clapp <doug.clapp () triad ! rr ! com>
Date:       2012-07-24 23:20:05
Message-ID: 500F2DA5.7020001 () triad ! rr ! com
[Download RAW message or body]

Actually, I didn't need to fix it on my system, but John Spencer wrote 
"the unzip applet may be a candidate for custom argv parsing code, 
getopt doesn't seem to be a good fit in this case" and I couldn't resist 
the challenge.

Thanks for the specifics.

Doug Clapp

Denys Vlasenko wrote:
> On Wed, Jul 18, 2012 at 8:52 PM, Doug Clapp <doug.clapp@triad.rr.com> wrote:
>>> Please send a diff.
>>> Please follow code style of the surrounding code.
>>> Please use tabs consistently.
>>>
>> Try this.  I added more comments and tweaked the usage information slightly,
>> as well as reworking the indentation.  If the code style is still a
>> mismatch, could you be more specific about how it differs?
>      int argind=1;
>
> should be
>
>      int argind = 1;
>
> +<----->        <----------trailing tab
> +       if (argc < 2) bb_show_usage();
> +<----->        <----------trailing tab
> +       while (argv[argind][0]==dash[0]){
> +               if(!argv[argind][1])  <---trailing space
>
>
> +       if(argc>argind){
> +          src_fn = xmalloc(strlen(argv[argind]) + 5);
> +          strcpy(src_fn, argv[argind]);
> +          argind++;
> +       }
>
> broken indentation.
>
>
>      char dash[] = "-";
>
> should be
>
>      static cosnt char dash[] = "-";
>
> etc.
>
> Do you really need to fix this, though? Can't you
> to use a libc which supports glibc extension in getopt?
>

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic