aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/od_bloaty.c23
-rwxr-xr-xtestsuite/od.tests7
2 files changed, 15 insertions, 15 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 51fff436b..57a4fe163 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -49,20 +49,21 @@ enum {
49 OPT_j = 1 << 9, 49 OPT_j = 1 << 9,
50 OPT_l = 1 << 10, 50 OPT_l = 1 << 10,
51 OPT_o = 1 << 11, 51 OPT_o = 1 << 11,
52 OPT_t = 1 << 12, 52 OPT_B = 1 << 12, /* undocumented synonym to -o */
53 OPT_t = 1 << 13,
53 /* When zero and two or more consecutive blocks are equal, format 54 /* When zero and two or more consecutive blocks are equal, format
54 only the first block and output an asterisk alone on the following 55 only the first block and output an asterisk alone on the following
55 line to indicate that identical blocks have been elided: */ 56 line to indicate that identical blocks have been elided: */
56 OPT_v = 1 << 13, 57 OPT_v = 1 << 14,
57 OPT_x = 1 << 14, 58 OPT_x = 1 << 15,
58 OPT_s = 1 << 15, 59 OPT_s = 1 << 16,
59 OPT_S = 1 << 16, 60 OPT_S = 1 << 17,
60 OPT_w = 1 << 17, 61 OPT_w = 1 << 18,
61 OPT_traditional = (1 << 18) * ENABLE_LONG_OPTS, 62 OPT_traditional = (1 << 19) * ENABLE_LONG_OPTS,
62}; 63};
63 64
64#define OD_GETOPT32() getopt32long(argv, \ 65#define OD_GETOPT32() getopt32long(argv, \
65 "A:N:abcdfhij:lot:*vxsS:w:+:", od_longopts, \ 66 "A:N:abcdfhij:loBt:*vxsS:w:+:", od_longopts, \
66 /* -w with optional param */ \ 67 /* -w with optional param */ \
67 /* -S was -s and also had optional parameter */ \ 68 /* -S was -s and also had optional parameter */ \
68 /* but in coreutils 6.3 it was renamed and now has */ \ 69 /* but in coreutils 6.3 it was renamed and now has */ \
@@ -1239,22 +1240,22 @@ int od_main(int argc UNUSED_PARAM, char **argv)
1239 if (opt & OPT_N) { 1240 if (opt & OPT_N) {
1240 max_bytes_to_format = xstrtooff_sfx(str_N, 0, bkm_suffixes); 1241 max_bytes_to_format = xstrtooff_sfx(str_N, 0, bkm_suffixes);
1241 } 1242 }
1243
1242 if (opt & OPT_a) decode_format_string("a"); 1244 if (opt & OPT_a) decode_format_string("a");
1243 if (opt & OPT_b) decode_format_string("oC"); 1245 if (opt & OPT_b) decode_format_string("oC");
1244 if (opt & OPT_c) decode_format_string("c"); 1246 if (opt & OPT_c) decode_format_string("c");
1245 if (opt & OPT_d) decode_format_string("u2"); 1247 if (opt & OPT_d) decode_format_string("u2");
1246 if (opt & OPT_f) decode_format_string("fF"); 1248 if (opt & OPT_f) decode_format_string("fF");
1247 if (opt & OPT_h) decode_format_string("x2"); 1249 if (opt & (OPT_h|OPT_x)) decode_format_string("x2");
1248 if (opt & OPT_i) decode_format_string("dI"); 1250 if (opt & OPT_i) decode_format_string("dI");
1249 if (opt & OPT_j) n_bytes_to_skip = xstrtooff_sfx(str_j, 0, bkm_suffixes); 1251 if (opt & OPT_j) n_bytes_to_skip = xstrtooff_sfx(str_j, 0, bkm_suffixes);
1250 /* This probably also depends on word width of the arch (what is "long"?) */ 1252 /* This probably also depends on word width of the arch (what is "long"?) */
1251 /* should be "d4" or "d8" depending on sizeof(long)? */ 1253 /* should be "d4" or "d8" depending on sizeof(long)? */
1252 if (opt & OPT_l) decode_format_string("d8"); 1254 if (opt & OPT_l) decode_format_string("d8");
1253 if (opt & OPT_o) decode_format_string("o2"); 1255 if (opt & (OPT_o|OPT_B)) decode_format_string("o2");
1254 while (lst_t) { 1256 while (lst_t) {
1255 decode_format_string(llist_pop(&lst_t)); 1257 decode_format_string(llist_pop(&lst_t));
1256 } 1258 }
1257 if (opt & OPT_x) decode_format_string("x2");
1258 if (opt & OPT_s) decode_format_string("d2"); 1259 if (opt & OPT_s) decode_format_string("d2");
1259 if (opt & OPT_S) { 1260 if (opt & OPT_S) {
1260 G.string_min = xstrtou_sfx(str_S, 0, bkm_suffixes); 1261 G.string_min = xstrtou_sfx(str_S, 0, bkm_suffixes);
diff --git a/testsuite/od.tests b/testsuite/od.tests
index fa6745b78..29ca829d5 100755
--- a/testsuite/od.tests
+++ b/testsuite/od.tests
@@ -38,8 +38,7 @@ testing "od -a (DESKTOP)" \
38 "" "$input" 38 "" "$input"
39SKIP= 39SKIP=
40 40
41optional !DESKTOP #DESKTOP: unrecognized option: B 41testing "od -B" \
42testing "od -B (!DESKTOP)" \
43 "od -B | sed 's/ *$//'" \ 42 "od -B | sed 's/ *$//'" \
44"\ 43"\
450000000 001001 005003 041101 177103 440000000 001001 005003 041101 177103
@@ -117,10 +116,10 @@ testing "od -F (!DESKTOP little-endian)" \
1170000010 1160000010
118" \ 117" \
119 "" "$input" 118 "" "$input"
119SKIP=
120 120
121#optional !DESKTOP
122$le || SKIP=1 121$le || SKIP=1
123testing "od -f (!DESKTOP little-endian)" \ 122testing "od -f (little-endian)" \
124 "od -f | sed 's/ *$//'" \ 123 "od -f | sed 's/ *$//'" \
125"\ 124"\
1260000000 6.3077975e-33 -6.4885867e+37 1250000000 6.3077975e-33 -6.4885867e+37