[Toybox] [PATCH] Fix od output format when using only legacy type specifiers

Rob Landley rob at landley.net
Fri Apr 25 03:55:21 PDT 2014


On 04/24/14 18:47, Samuel Holland wrote:
> Toybox had been adding the default "oS" output format unless an explicit
> -t option had been given, even if one of the legacy shortcut options was
> given.

Oops.

> This behavior broke building busybox with CONFIG_FEATURE_COMPRESS_USAGE
> as it uses "od -v -b" in applets/usage_compressed

Busybox defconfig won't build with busybox's tr command (the libm
probing fails), so I'm not _too_ embarassed about that.  Still need to
fix it, though. :)

> -  if (!TT.output_base) append_base("o2");
> +  if (!TT.output_base && !(toys.optflags &
> +       (FLAG_b|FLAG_c|FLAG_d|FLAG_o|FLAG_s|FLAG_x)))
> append_base("o2");

Hmmm, that's a much more complicated test, and it's essentially
repeating the flag list right above it.

The TT.output_base check was _supposed_ to cover this. The intended
logic was "only add an output type if we haven't already got an output
type", but output_base is the explicit list of command line output types
so it's checking the wrong variable. TT.types is the count of output
types (incremented by append_base) so checking that's not zero is the
correct thing to do.

Checked in the smaller fix.

Thanks,

Rob

 1398423321.0


More information about the Toybox mailing list