unzip applet not working ?
Doug Clapp
doug.clapp at triad.rr.com
Tue Jul 24 23:20:05 UTC 2012
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 at 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?
>
More information about the busybox
mailing list