aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cal.c2
-rw-r--r--coreutils/date.c2
-rw-r--r--coreutils/stty.c24
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/wc.c16
-rw-r--r--coreutils/who.c1
7 files changed, 31 insertions, 18 deletions
diff --git a/coreutils/cal.c b/coreutils/cal.c
index ef5dbeadb..f18c16120 100644
--- a/coreutils/cal.c
+++ b/coreutils/cal.c
@@ -138,7 +138,7 @@ int cal_main(int argc UNUSED_PARAM, char **argv)
138 if (julian) 138 if (julian)
139 *hp++ = ' '; 139 *hp++ = ' ';
140 { 140 {
141 char *two_wchars = unicode_conv_to_printable_fixedwidth(NULL, buf, 2); 141 char *two_wchars = unicode_conv_to_printable_fixedwidth(/*NULL,*/ buf, 2);
142 strcpy(hp, two_wchars); 142 strcpy(hp, two_wchars);
143 free(two_wchars); 143 free(two_wchars);
144 } 144 }
diff --git a/coreutils/date.c b/coreutils/date.c
index 22d0a5327..d36ed83fd 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -19,7 +19,7 @@
19/* Input parsing code is always bulky - used heavy duty libc stuff as 19/* Input parsing code is always bulky - used heavy duty libc stuff as
20 much as possible, missed out a lot of bounds checking */ 20 much as possible, missed out a lot of bounds checking */
21 21
22//applet:IF_DATE(APPLET(date, _BB_DIR_BIN, _BB_SUID_DROP)) 22//applet:IF_DATE(APPLET(date, BB_DIR_BIN, BB_SUID_DROP))
23 23
24//kbuild:lib-$(CONFIG_DATE) += date.o 24//kbuild:lib-$(CONFIG_DATE) += date.o
25 25
diff --git a/coreutils/stty.c b/coreutils/stty.c
index e28e15c97..1dd01c4dd 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -59,6 +59,10 @@
59#if defined(VEOL2) && !defined(CEOL2) 59#if defined(VEOL2) && !defined(CEOL2)
60# define CEOL2 _POSIX_VDISABLE 60# define CEOL2 _POSIX_VDISABLE
61#endif 61#endif
62/* glibc-2.12.1 uses only VSWTC name */
63#if defined(VSWTC) && !defined(VSWTCH)
64# define VSWTCH VSWTC
65#endif
62/* ISC renamed swtch to susp for termios, but we'll accept either name */ 66/* ISC renamed swtch to susp for termios, but we'll accept either name */
63#if defined(VSUSP) && !defined(VSWTCH) 67#if defined(VSUSP) && !defined(VSWTCH)
64# define VSWTCH VSUSP 68# define VSWTCH VSUSP
@@ -221,6 +225,9 @@
221#ifndef XCASE 225#ifndef XCASE
222# define XCASE 0 226# define XCASE 0
223#endif 227#endif
228#ifndef IUTF8
229# define IUTF8 0
230#endif
224 231
225/* Which speeds to set */ 232/* Which speeds to set */
226enum speed_setting { 233enum speed_setting {
@@ -348,6 +355,9 @@ static const char mode_name[] =
348#if IMAXBEL 355#if IMAXBEL
349 MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 ) 356 MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 )
350#endif 357#endif
358#if IUTF8
359 MI_ENTRY("iutf8", input, SANE_UNSET | REV, IUTF8, 0 )
360#endif
351 MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 ) 361 MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 )
352#if OLCUC 362#if OLCUC
353 MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 ) 363 MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 )
@@ -502,6 +512,9 @@ static const struct mode_info mode_info[] = {
502#if IMAXBEL 512#if IMAXBEL
503 MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 ) 513 MI_ENTRY("imaxbel", input, SANE_SET | REV, IMAXBEL, 0 )
504#endif 514#endif
515#if IUTF8
516 MI_ENTRY("iutf8", input, SANE_UNSET | REV, IUTF8, 0 )
517#endif
505 MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 ) 518 MI_ENTRY("opost", output, SANE_SET | REV, OPOST, 0 )
506#if OLCUC 519#if OLCUC
507 MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 ) 520 MI_ENTRY("olcuc", output, SANE_UNSET | REV, OLCUC, 0 )
@@ -991,8 +1004,9 @@ static void display_speed(const struct termios *mode, int fancy)
991 const char *fmt_str = "%lu %lu\n\0ispeed %lu baud; ospeed %lu baud;"; 1004 const char *fmt_str = "%lu %lu\n\0ispeed %lu baud; ospeed %lu baud;";
992 unsigned long ispeed, ospeed; 1005 unsigned long ispeed, ospeed;
993 1006
994 ospeed = ispeed = cfgetispeed(mode); 1007 ispeed = cfgetispeed(mode);
995 if (ispeed == 0 || ispeed == (ospeed = cfgetospeed(mode))) { 1008 ospeed = cfgetospeed(mode);
1009 if (ispeed == 0 || ispeed == ospeed) {
996 ispeed = ospeed; /* in case ispeed was 0 */ 1010 ispeed = ospeed; /* in case ispeed was 0 */
997 //________ 0123 4 5 6 7 8 9 1011 //________ 0123 4 5 6 7 8 9
998 fmt_str = "%lu\n\0\0\0\0\0speed %lu baud;"; 1012 fmt_str = "%lu\n\0\0\0\0\0speed %lu baud;";
@@ -1011,7 +1025,7 @@ static void do_display(const struct termios *mode, int all)
1011 display_speed(mode, 1); 1025 display_speed(mode, 1);
1012 if (all) 1026 if (all)
1013 display_window_size(1); 1027 display_window_size(1);
1014#ifdef HAVE_C_LINE 1028#ifdef __linux__
1015 wrapf("line = %u;\n", mode->c_line); 1029 wrapf("line = %u;\n", mode->c_line);
1016#else 1030#else
1017 newline(); 1031 newline();
@@ -1344,7 +1358,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1344 } 1358 }
1345 1359
1346 switch (param) { 1360 switch (param) {
1347#ifdef HAVE_C_LINE 1361#ifdef __linux__
1348 case param_line: 1362 case param_line:
1349# ifndef TIOCGWINSZ 1363# ifndef TIOCGWINSZ
1350 xatoul_range_sfx(argnext, 1, INT_MAX, stty_suffixes); 1364 xatoul_range_sfx(argnext, 1, INT_MAX, stty_suffixes);
@@ -1448,7 +1462,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
1448 } 1462 }
1449 1463
1450 switch (param) { 1464 switch (param) {
1451#ifdef HAVE_C_LINE 1465#ifdef __linux__
1452 case param_line: 1466 case param_line:
1453 mode.c_line = xatoul_sfx(argnext, stty_suffixes); 1467 mode.c_line = xatoul_sfx(argnext, stty_suffixes);
1454 stty_state |= STTY_require_set_attr; 1468 stty_state |= STTY_require_set_attr;
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 6c2b948e6..c51fb70ca 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -26,7 +26,7 @@
26//config: touch is used to create or change the access and/or 26//config: touch is used to create or change the access and/or
27//config: modification timestamp of specified files. 27//config: modification timestamp of specified files.
28 28
29//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, _BB_DIR_BIN, _BB_SUID_DROP, touch)) 29//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, BB_DIR_BIN, BB_SUID_DROP, touch))
30 30
31//kbuild:lib-$(CONFIG_TOUCH) += touch.o 31//kbuild:lib-$(CONFIG_TOUCH) += touch.o
32 32
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 0c4311f24..56ed254e5 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -132,7 +132,7 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv)
132} 132}
133#endif 133#endif
134 134
135//applet:IF_BASE64(APPLET(base64, _BB_DIR_BIN, _BB_SUID_DROP)) 135//applet:IF_BASE64(APPLET(base64, BB_DIR_BIN, BB_SUID_DROP))
136 136
137//kbuild:lib-$(CONFIG_BASE64) += uudecode.o 137//kbuild:lib-$(CONFIG_BASE64) += uudecode.o
138 138
diff --git a/coreutils/wc.c b/coreutils/wc.c
index fe3f274f8..6e22c66c8 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -81,11 +81,11 @@
81 * column order in "wc -cmlwL" output: 81 * column order in "wc -cmlwL" output:
82 */ 82 */
83enum { 83enum {
84 WC_LINES = 0, 84 WC_LINES = 0, /* -l */
85 WC_WORDS = 1, 85 WC_WORDS = 1, /* -w */
86 WC_UNICHARS = 2, 86 WC_UNICHARS = 2, /* -m */
87 WC_CHARS = 3, 87 WC_BYTES = 3, /* -c */
88 WC_LENGTH = 4, 88 WC_LENGTH = 4, /* -L */
89 NUM_WCS = 5, 89 NUM_WCS = 5,
90}; 90};
91 91
@@ -104,10 +104,10 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
104 104
105 init_unicode(); 105 init_unicode();
106 106
107 print_type = getopt32(argv, "lwcmL"); 107 print_type = getopt32(argv, "lwmcL");
108 108
109 if (print_type == 0) { 109 if (print_type == 0) {
110 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS); 110 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_BYTES);
111 } 111 }
112 112
113 argv += optind; 113 argv += optind;
@@ -157,7 +157,7 @@ int wc_main(int argc UNUSED_PARAM, char **argv)
157 } 157 }
158 158
159 /* Cater for -c and -m */ 159 /* Cater for -c and -m */
160 ++counts[WC_CHARS]; 160 ++counts[WC_BYTES];
161 if (unicode_status != UNICODE_ON /* every byte is a new char */ 161 if (unicode_status != UNICODE_ON /* every byte is a new char */
162 || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */ 162 || (c & 0xc0) != 0x80 /* it isn't a 2nd+ byte of a Unicode char */
163 ) { 163 ) {
diff --git a/coreutils/who.c b/coreutils/who.c
index 8384d9534..ab1e30fc8 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -19,7 +19,6 @@
19/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ 19/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */
20 20
21#include "libbb.h" 21#include "libbb.h"
22#include <utmp.h>
23 22
24static void idle_string(char *str6, time_t t) 23static void idle_string(char *str6, time_t t)
25{ 24{