aboutsummaryrefslogtreecommitdiff
path: root/coreutils/tail.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-02 12:57:26 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-02 12:57:26 +0200
commitea8b252cb30c4b4463df43a5342af95931920f09 (patch)
treeb32f4cfd202c9b98cbb2a59bb5a629275e1b4119 /coreutils/tail.c
parent8837c5dec402fd6782589c0a676bc7f90dea4061 (diff)
downloadbusybox-w32-ea8b252cb30c4b4463df43a5342af95931920f09.tar.gz
busybox-w32-ea8b252cb30c4b4463df43a5342af95931920f09.tar.bz2
busybox-w32-ea8b252cb30c4b4463df43a5342af95931920f09.zip
*: better string sharing
text data bss dec hex filename 849427 441 7556 857424 d1550 busybox_old 849355 441 7556 857352 d1508 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 8fc22f562..6397702a0 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -66,7 +66,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
66 return r; 66 return r;
67} 67}
68 68
69static const char header_fmt[] ALIGN1 = "\n==> %s <==\n"; 69#define header_fmt_str "\n==> %s <==\n"
70 70
71static unsigned eat_num(const char *p) 71static unsigned eat_num(const char *p)
72{ 72{
@@ -166,7 +166,7 @@ int tail_main(int argc, char **argv)
166 tailbuf = xmalloc(tailbufsize); 166 tailbuf = xmalloc(tailbufsize);
167 167
168 /* tail the files */ 168 /* tail the files */
169 fmt = header_fmt + 1; /* skip header leading newline on first output */ 169 fmt = header_fmt_str + 1; /* skip header leading newline on first output */
170 i = 0; 170 i = 0;
171 do { 171 do {
172 char *buf; 172 char *buf;
@@ -181,7 +181,7 @@ int tail_main(int argc, char **argv)
181 181
182 if (nfiles > header_threshhold) { 182 if (nfiles > header_threshhold) {
183 tail_xprint_header(fmt, argv[i]); 183 tail_xprint_header(fmt, argv[i]);
184 fmt = header_fmt; 184 fmt = header_fmt_str;
185 } 185 }
186 186
187 if (!from_top) { 187 if (!from_top) {
@@ -333,7 +333,7 @@ int tail_main(int argc, char **argv)
333 if (ENABLE_FEATURE_FANCY_TAIL && fd < 0) 333 if (ENABLE_FEATURE_FANCY_TAIL && fd < 0)
334 continue; 334 continue;
335 if (nfiles > header_threshhold) { 335 if (nfiles > header_threshhold) {
336 fmt = header_fmt; 336 fmt = header_fmt_str;
337 } 337 }
338 while ((nread = tail_read(fd, tailbuf, BUFSIZ)) > 0) { 338 while ((nread = tail_read(fd, tailbuf, BUFSIZ)) > 0) {
339 if (fmt) { 339 if (fmt) {