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

Samuel Holland samuel at sholland.net
Thu Apr 24 16:47:10 PDT 2014


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.

This behavior broke building busybox with CONFIG_FEATURE_COMPRESS_USAGE 
as it uses "od -v -b" in applets/usage_compressed
---
  toys/posix/od.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/toys/posix/od.c b/toys/posix/od.c
index 6c7cc94..10fcc39 100644
--- a/toys/posix/od.c
+++ b/toys/posix/od.c
@@ -278,7 +278,8 @@ void od_main(void)
    if (toys.optflags & FLAG_o) append_base("o2");
    if (toys.optflags & FLAG_s) append_base("d2");
    if (toys.optflags & FLAG_x) append_base("x2");
-  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");

    loopfiles(toys.optargs, do_od);


 1398383230.0


More information about the Toybox mailing list