aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
committerRon Yorston <rmy@pobox.com>2021-02-05 11:24:06 +0000
commit32e19e7ae8b0d76d69871ba234e8f0af31baff4e (patch)
tree6fdc833a444e0dd6fd359b21a8d463856917a387 /coreutils
parent4fb71406b884c6ac0a9a4d2acf7a32b544611f70 (diff)
parentcad3fc743aa7c7744e4fcf044371f0fda50fa51f (diff)
downloadbusybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.gz
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.tar.bz2
busybox-w32-32e19e7ae8b0d76d69871ba234e8f0af31baff4e.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cat.c4
-rw-r--r--coreutils/cut.c2
-rw-r--r--coreutils/expand.c2
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/nl.c2
-rw-r--r--coreutils/od_bloaty.c26
-rw-r--r--coreutils/paste.c4
-rw-r--r--coreutils/stat.c2
-rw-r--r--coreutils/stty.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/yes.c2
13 files changed, 27 insertions, 27 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 65f0648f9..4b3414941 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -152,7 +152,7 @@ static int catv(unsigned opts, char **argv)
152 eol_seen = (c == eol_char); 152 eol_seen = (c == eol_char);
153#endif 153#endif
154 visible(c, buf, opts); 154 visible(c, buf, opts);
155 fputs(buf, stdout); 155 fputs_stdout(buf);
156 } 156 }
157 } 157 }
158 if (ENABLE_FEATURE_CLEAN_UP && fd) 158 if (ENABLE_FEATURE_CLEAN_UP && fd)
@@ -201,7 +201,7 @@ int cat_main(int argc UNUSED_PARAM, char **argv)
201 ns.start = 1; 201 ns.start = 1;
202 ns.inc = 1; 202 ns.inc = 1;
203 ns.sep = "\t"; 203 ns.sep = "\t";
204 ns.empty_str = "\n"; 204 ns.empty_str = NULL;
205 ns.all = !(opts & CAT_OPT_b); /* -n without -b */ 205 ns.all = !(opts & CAT_OPT_b); /* -n without -b */
206 ns.nonempty = (opts & CAT_OPT_b); /* -b (with or without -n) */ 206 ns.nonempty = (opts & CAT_OPT_b); /* -b (with or without -n) */
207 exitcode = EXIT_SUCCESS; 207 exitcode = EXIT_SUCCESS;
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 1acbb513e..16418ff33 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -167,7 +167,7 @@ static void cut_file(FILE *file, char delim, const struct cut_list *cut_lists, u
167 * printed */ 167 * printed */
168 if (nfields_printed > 0) 168 if (nfields_printed > 0)
169 putchar(delim); 169 putchar(delim);
170 fputs(field, stdout); 170 fputs_stdout(field);
171 printed[ndelim] = 'X'; 171 printed[ndelim] = 'X';
172 nfields_printed++; /* shouldn't overflow.. */ 172 nfields_printed++; /* shouldn't overflow.. */
173 } 173 }
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 5f5993921..c5e1de6f5 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -123,7 +123,7 @@ static void expand(FILE *file, unsigned tab_size, unsigned opt)
123 } 123 }
124 ptr++; 124 ptr++;
125 } 125 }
126 fputs(ptr_strbeg, stdout); 126 fputs_stdout(ptr_strbeg);
127 free(line); 127 free(line);
128 } 128 }
129} 129}
diff --git a/coreutils/head.c b/coreutils/head.c
index 1219dfe8b..b6efabbe0 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -117,7 +117,7 @@ print_except_N_last_lines(FILE *fp, unsigned count)
117 char *c; 117 char *c;
118 if (head == count) 118 if (head == count)
119 head = 0; 119 head = 0;
120 fputs(circle[head], stdout); 120 fputs_stdout(circle[head]);
121 c = xmalloc_fgets(fp); 121 c = xmalloc_fgets(fp);
122 if (!c) 122 if (!c)
123 goto ret; 123 goto ret;
diff --git a/coreutils/id.c b/coreutils/id.c
index 78d5f2a50..f453a87ae 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -258,7 +258,7 @@ int id_main(int argc UNUSED_PARAM, char **argv)
258 bb_error_msg_and_die("can't get process context%s", 258 bb_error_msg_and_die("can't get process context%s",
259 username ? " for a different user" : ""); 259 username ? " for a different user" : "");
260 } 260 }
261 fputs(scontext, stdout); 261 fputs_stdout(scontext);
262 } 262 }
263 /* freecon(NULL) seems to be harmless */ 263 /* freecon(NULL) seems to be harmless */
264 if (ENABLE_FEATURE_CLEAN_UP) 264 if (ENABLE_FEATURE_CLEAN_UP)
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 2f9338f19..e891a67ce 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -456,7 +456,7 @@ static unsigned print_name(const char *name)
456 name = printable_string2(&uni_stat, name); 456 name = printable_string2(&uni_stat, name);
457 457
458 if (!(option_mask32 & OPT_Q)) { 458 if (!(option_mask32 & OPT_Q)) {
459 fputs(name, stdout); 459 fputs_stdout(name);
460 return uni_stat.unicode_width; 460 return uni_stat.unicode_width;
461 } 461 }
462 462
diff --git a/coreutils/nl.c b/coreutils/nl.c
index 800b73c26..d06673881 100644
--- a/coreutils/nl.c
+++ b/coreutils/nl.c
@@ -68,7 +68,7 @@ int nl_main(int argc UNUSED_PARAM, char **argv)
68 &ns.width, &ns.sep, &ns.start, &ns.inc, &opt_b); 68 &ns.width, &ns.sep, &ns.start, &ns.inc, &opt_b);
69 ns.all = (opt_b[0] == 'a'); 69 ns.all = (opt_b[0] == 'a');
70 ns.nonempty = (opt_b[0] == 't'); 70 ns.nonempty = (opt_b[0] == 't');
71 ns.empty_str = xasprintf("%*s\n", ns.width + (int)strlen(ns.sep), ""); 71 ns.empty_str = xasprintf("%*s", ns.width + (int)strlen(ns.sep), "");
72 72
73 argv += optind; 73 argv += optind;
74 if (!*argv) 74 if (!*argv)
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 76ee5137a..1830aca83 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -429,19 +429,19 @@ print_named_ascii(size_t n_bytes, const char *block,
429 429
430 masked_c &= 0x7f; 430 masked_c &= 0x7f;
431 if (masked_c == 0x7f) { 431 if (masked_c == 0x7f) {
432 fputs(" del", stdout); 432 fputs_stdout(" del");
433 continue; 433 continue;
434 } 434 }
435 if (masked_c > ' ') { 435 if (masked_c > ' ') {
436 buf[3] = masked_c; 436 buf[3] = masked_c;
437 fputs(buf, stdout); 437 fputs_stdout(buf);
438 continue; 438 continue;
439 } 439 }
440 /* Why? Because printf(" %3.3s") is much slower... */ 440 /* Why? Because printf(" %3.3s") is much slower... */
441 buf[6] = charname[masked_c][0]; 441 buf[6] = charname[masked_c][0];
442 buf[7] = charname[masked_c][1]; 442 buf[7] = charname[masked_c][1];
443 buf[8] = charname[masked_c][2]; 443 buf[8] = charname[masked_c][2];
444 fputs(buf+5, stdout); 444 fputs_stdout(buf+5);
445 } 445 }
446} 446}
447 447
@@ -458,7 +458,7 @@ print_ascii(size_t n_bytes, const char *block,
458 458
459 if (ISPRINT(c)) { 459 if (ISPRINT(c)) {
460 buf[3] = c; 460 buf[3] = c;
461 fputs(buf, stdout); 461 fputs_stdout(buf);
462 continue; 462 continue;
463 } 463 }
464 switch (c) { 464 switch (c) {
@@ -492,7 +492,7 @@ print_ascii(size_t n_bytes, const char *block,
492 buf[8] = (c & 7) + '0'; 492 buf[8] = (c & 7) + '0';
493 s = buf + 5; 493 s = buf + 5;
494 } 494 }
495 fputs(s, stdout); 495 fputs_stdout(s);
496 } 496 }
497} 497}
498 498
@@ -888,7 +888,7 @@ format_address_label(off_t address, char c)
888static void 888static void
889dump_hexl_mode_trailer(size_t n_bytes, const char *block) 889dump_hexl_mode_trailer(size_t n_bytes, const char *block)
890{ 890{
891 fputs(" >", stdout); 891 fputs_stdout(" >");
892 while (n_bytes--) { 892 while (n_bytes--) {
893 unsigned c = *(unsigned char *) block++; 893 unsigned c = *(unsigned char *) block++;
894 c = (ISPRINT(c) ? c : '.'); 894 c = (ISPRINT(c) ? c : '.');
@@ -1128,13 +1128,13 @@ dump_strings(off_t address, off_t end_offset)
1128 1128
1129 for (i = 0; (c = buf[i]); i++) { 1129 for (i = 0; (c = buf[i]); i++) {
1130 switch (c) { 1130 switch (c) {
1131 case '\007': fputs("\\a", stdout); break; 1131 case '\007': fputs_stdout("\\a"); break;
1132 case '\b': fputs("\\b", stdout); break; 1132 case '\b': fputs_stdout("\\b"); break;
1133 case '\f': fputs("\\f", stdout); break; 1133 case '\f': fputs_stdout("\\f"); break;
1134 case '\n': fputs("\\n", stdout); break; 1134 case '\n': fputs_stdout("\\n"); break;
1135 case '\r': fputs("\\r", stdout); break; 1135 case '\r': fputs_stdout("\\r"); break;
1136 case '\t': fputs("\\t", stdout); break; 1136 case '\t': fputs_stdout("\\t"); break;
1137 case '\v': fputs("\\v", stdout); break; 1137 case '\v': fputs_stdout("\\v"); break;
1138 default: putchar(c); 1138 default: putchar(c);
1139 } 1139 }
1140 } 1140 }
diff --git a/coreutils/paste.c b/coreutils/paste.c
index fd2aa5027..7def4de11 100644
--- a/coreutils/paste.c
+++ b/coreutils/paste.c
@@ -53,7 +53,7 @@ static void paste_files(FILE** files, int file_cnt, char* delims, int del_cnt)
53 --active_files; 53 --active_files;
54 continue; 54 continue;
55 } 55 }
56 fputs(line, stdout); 56 fputs_stdout(line);
57 free(line); 57 free(line);
58 delim = '\n'; 58 delim = '\n';
59 if (i != file_cnt - 1) { 59 if (i != file_cnt - 1) {
@@ -79,7 +79,7 @@ static void paste_files_separate(FILE** files, char* delims, int del_cnt)
79 line = NULL; 79 line = NULL;
80 while ((next_line = xmalloc_fgetline(files[i])) != NULL) { 80 while ((next_line = xmalloc_fgetline(files[i])) != NULL) {
81 if (line) { 81 if (line) {
82 fputs(line, stdout); 82 fputs_stdout(line);
83 free(line); 83 free(line);
84 delim = delims[del_idx++]; 84 delim = delims[del_idx++];
85 if (del_idx == del_cnt) 85 if (del_idx == del_cnt)
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 1267df450..1e93dce80 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -445,7 +445,7 @@ static void print_it(const char *masterformat,
445 445
446 /* print preceding string */ 446 /* print preceding string */
447 *p = '\0'; 447 *p = '\0';
448 fputs(b, stdout); 448 fputs_stdout(b);
449 449
450 p += len; 450 p += len;
451 b = p + 1; 451 b = p + 1;
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 19253964c..ba2b78317 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -855,7 +855,7 @@ static void wrapf(const char *message, ...)
855 } 855 }
856 } 856 }
857 } 857 }
858 fputs(buf, stdout); 858 fputs_stdout(buf);
859 G.current_col += buflen; 859 G.current_col += buflen;
860 if (buf[buflen-1] == '\n') 860 if (buf[buflen-1] == '\n')
861 G.current_col = 0; 861 G.current_col = 0;
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 164b208ea..02b037276 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -319,7 +319,7 @@ int baseNUM_main(int argc UNUSED_PARAM, char **argv)
319 } 319 }
320 320
321 if (col == 0) { 321 if (col == 0) {
322 fputs(dst_buf, stdout); 322 fputs_stdout(dst_buf);
323 } else { 323 } else {
324 char *result = dst_buf; 324 char *result = dst_buf;
325 if (rem == 0) 325 if (rem == 0)
diff --git a/coreutils/yes.c b/coreutils/yes.c
index a51b1ad8e..38ffff46c 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -47,7 +47,7 @@ int yes_main(int argc UNUSED_PARAM, char **argv)
47#endif 47#endif
48 pp = argv; 48 pp = argv;
49 while (1) { 49 while (1) {
50 fputs(*pp, stdout); 50 fputs_stdout(*pp);
51 if (!*++pp) 51 if (!*++pp)
52 break; 52 break;
53 putchar(' '); 53 putchar(' ');