redundant code in unzip.c ?

Glenn L. McGrath bug1 at ihug.co.nz
Wed Jun 7 07:37:54 UTC 2006


On Sun, 4 Jun 2006 22:25:45 +0200
Bernhard Fischer <rep.nop at aon.at> wrote:

> Hi,
> 
> in unzip.c, one can read:
> 
> Index: archival/unzip.c
> ===================================================================
> --- archival/unzip.c    (revision 15268)
> +++ archival/unzip.c    (working copy)
> @@ -320,9 +320,9 @@
>                     if (verbosity == v_normal) {
>                         printf("   creating: %s\n", dst_fn);
>                     }
>                     unzip_create_leading_dirs(dst_fn);
> +// isn't this call ---v already done by unzip_create_leading_dirs above?
>                     if (bb_make_directory(dst_fn, 0777, 0)) {
> +// --------------------^
> -		bb_error_msg_and_die("Failed to create directory");
> +		bb_error_msg_and_die("Exiting");
>                     }
>                 } else {
> 
> Also, repeating the error message which was already emitted by
> bb_make_directory() sounds odd, so just saying "Exiting" should be
> enough, i'd say.
> If the call really is redundant, the whole if should be deleted.

I agree, they shouldnt be there.

If that unzip_create_leading_dirs call is removed then the whole
function could be removed as its only used 1 other time.

Look back in CVS it looks like i checked it in, dont why, must have jsut been a mistake.


Glenn



More information about the busybox mailing list