[PATCH] fdisk.c: major whitespace/style cleanup

Rob Landley rob at landley.net
Fri Feb 24 08:29:29 PST 2006


On Friday 24 February 2006 1:44 am, Denis Vlasenko wrote:
> Hi Rob,
>
> I'd like to work on making fdisk.c smaller and saner.
> But it needs a style cleanup first.

You've picked one of the apps that really can't be made much worse, so 
sure. :)

> With all fdisk-related CONFIG_ options on,
> produced object file is byte-identical to original:

Ok.

> One obvious bug spotted. Infinite loop:
>
> edit_int(int def, char *mesg)
> {
>     do {
>         fputs(mesg, stdout);
>         printf(" (%d): ", def);
>         if (!read_line())
>             return def;
>     }
>     while (!isdigit(*line_ptr));    /* FIXME: ?!! */
>     return atoi(line_ptr);
> }

The byte-identical bit would seem to imply you haven't fixed it yet. :)

> Please apply the patch.

My rebuild just did this:

  AR cru archival/libunarchive/libunarchive.a
gcc -I/home/landley/busybox/busybox/include 
-I/home/landley/busybox/busybox/include -I/home/landley/busybox/busybox/libbb 
-funsigned-char  -Wall -Wstrict-prototypes -Wshadow -Os -march=i386 
-mpreferred-stack-boundary=2 -falign-functions=0 -falign-jumps=0 
-falign-loops=0 -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG    \
        -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
         -c 
-o /home/landley/busybox/busybox/util-linux/fdisk.o /home/landley/busybox/busybox/util-linux/fdisk.c
  AR cru util-linux/util-linux.a

Which is confusing.  (The pretty printing hiccuped?)

Oh well, it built...

Applied.

> --
> vda

-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list