aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/head.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/coreutils/head.c b/coreutils/head.c
index 17d3ef890..184e8161c 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -25,6 +25,15 @@ static const char head_opts[] =
25#endif 25#endif
26 ; 26 ;
27 27
28#if ENABLE_FEATURE_FANCY_HEAD
29static const struct suffix_mult head_suffixes[] = {
30 { "b", 512 },
31 { "k", 1024 },
32 { "m", 1024*1024 },
33 { NULL, 0 }
34};
35#endif
36
28static const char header_fmt_str[] = "\n==> %s <==\n"; 37static const char header_fmt_str[] = "\n==> %s <==\n";
29 38
30int head_main(int argc, char **argv) 39int head_main(int argc, char **argv)
@@ -75,7 +84,14 @@ int head_main(int argc, char **argv)
75#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD 84#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
76 GET_COUNT: 85 GET_COUNT:
77#endif 86#endif
87
88#if !ENABLE_FEATURE_FANCY_HEAD
78 count = bb_xgetularg10(p); 89 count = bb_xgetularg10(p);
90#else
91 count = bb_xgetularg_bnd_sfx(p, 10,
92 0, ULONG_MAX,
93 head_suffixes);
94#endif
79 break; 95 break;
80 default: 96 default:
81 bb_show_usage(); 97 bb_show_usage();