diff options
| author | Ron Yorston <rmy@pobox.com> | 2013-02-07 14:25:54 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2013-02-07 14:25:54 +0000 |
| commit | b604585914e032b28bef3e337a978e56a9069cda (patch) | |
| tree | b2ee0a3fb38d10397c602d0fe215ea3bbbf334c0 /coreutils | |
| parent | 0eda07c7ff8cf1fc11bc1bda5383f884d7adf031 (diff) | |
| parent | ba76b7a40b929878833731f76306b1c977cc8650 (diff) | |
| download | busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.gz busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.bz2 busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/Config.src | 12 | ||||
| -rw-r--r-- | coreutils/Kbuild.src | 1 | ||||
| -rw-r--r-- | coreutils/cal.c | 15 | ||||
| -rw-r--r-- | coreutils/chown.c | 4 | ||||
| -rw-r--r-- | coreutils/cut.c | 2 | ||||
| -rw-r--r-- | coreutils/df.c | 8 | ||||
| -rw-r--r-- | coreutils/du.c | 4 | ||||
| -rw-r--r-- | coreutils/id.c | 2 | ||||
| -rw-r--r-- | coreutils/ls.c | 4 | ||||
| -rw-r--r-- | coreutils/md5_sha1_sum.c | 19 | ||||
| -rw-r--r-- | coreutils/mknod.c | 2 | ||||
| -rw-r--r-- | coreutils/od_bloaty.c | 4 | ||||
| -rw-r--r-- | coreutils/sort.c | 2 | ||||
| -rw-r--r-- | coreutils/stat.c | 58 | ||||
| -rw-r--r-- | coreutils/stty.c | 2 | ||||
| -rw-r--r-- | coreutils/sum.c | 4 | ||||
| -rw-r--r-- | coreutils/test.c | 2 |
17 files changed, 90 insertions, 55 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src index 2ca71521f..8e43c38e1 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src | |||
| @@ -517,6 +517,12 @@ config SHA512SUM | |||
| 517 | help | 517 | help |
| 518 | Compute and check SHA512 message digest | 518 | Compute and check SHA512 message digest |
| 519 | 519 | ||
| 520 | config SHA3SUM | ||
| 521 | bool "sha3sum" | ||
| 522 | default y | ||
| 523 | help | ||
| 524 | Compute and check SHA3 (512-bit) message digest | ||
| 525 | |||
| 520 | config SLEEP | 526 | config SLEEP |
| 521 | bool "sleep" | 527 | bool "sleep" |
| 522 | default y | 528 | default y |
| @@ -777,13 +783,13 @@ config FEATURE_HUMAN_READABLE | |||
| 777 | help | 783 | help |
| 778 | Allow df, du, and ls to have human readable output. | 784 | Allow df, du, and ls to have human readable output. |
| 779 | 785 | ||
| 780 | comment "Common options for md5sum, sha1sum, sha256sum, sha512sum" | 786 | comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" |
| 781 | depends on MD5SUM || SHA1SUM || SHA256SUM || SHA512SUM | 787 | depends on MD5SUM || SHA1SUM || SHA256SUM || SHA512SUM || SHA3SUM |
| 782 | 788 | ||
| 783 | config FEATURE_MD5_SHA1_SUM_CHECK | 789 | config FEATURE_MD5_SHA1_SUM_CHECK |
| 784 | bool "Enable -c, -s and -w options" | 790 | bool "Enable -c, -s and -w options" |
| 785 | default y | 791 | default y |
| 786 | depends on MD5SUM || SHA1SUM || SHA256SUM || SHA512SUM | 792 | depends on MD5SUM || SHA1SUM || SHA256SUM || SHA512SUM || SHA3SUM |
| 787 | help | 793 | help |
| 788 | Enabling the -c options allows files to be checked | 794 | Enabling the -c options allows files to be checked |
| 789 | against pre-calculated hash values. | 795 | against pre-calculated hash values. |
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index d6453f014..b715b9c47 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src | |||
| @@ -62,6 +62,7 @@ lib-$(CONFIG_SEQ) += seq.o | |||
| 62 | lib-$(CONFIG_SHA1SUM) += md5_sha1_sum.o | 62 | lib-$(CONFIG_SHA1SUM) += md5_sha1_sum.o |
| 63 | lib-$(CONFIG_SHA256SUM) += md5_sha1_sum.o | 63 | lib-$(CONFIG_SHA256SUM) += md5_sha1_sum.o |
| 64 | lib-$(CONFIG_SHA512SUM) += md5_sha1_sum.o | 64 | lib-$(CONFIG_SHA512SUM) += md5_sha1_sum.o |
| 65 | lib-$(CONFIG_SHA3SUM) += md5_sha1_sum.o | ||
| 65 | lib-$(CONFIG_SLEEP) += sleep.o | 66 | lib-$(CONFIG_SLEEP) += sleep.o |
| 66 | lib-$(CONFIG_SPLIT) += split.o | 67 | lib-$(CONFIG_SPLIT) += split.o |
| 67 | lib-$(CONFIG_SORT) += sort.o | 68 | lib-$(CONFIG_SORT) += sort.o |
diff --git a/coreutils/cal.c b/coreutils/cal.c index b470ad968..0d388aa1c 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
| @@ -43,7 +43,7 @@ static const unsigned char days_in_month[] ALIGN1 = { | |||
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | static const unsigned char sep1752[] ALIGN1 = { | 45 | static const unsigned char sep1752[] ALIGN1 = { |
| 46 | 1, 2, 14, 15, 16, | 46 | 1, 2, 14, 15, 16, |
| 47 | 17, 18, 19, 20, 21, 22, 23, | 47 | 17, 18, 19, 20, 21, 22, 23, |
| 48 | 24, 25, 26, 27, 28, 29, 30 | 48 | 24, 25, 26, 27, 28, 29, 30 |
| 49 | }; | 49 | }; |
| @@ -167,8 +167,8 @@ int cal_main(int argc UNUSED_PARAM, char **argv) | |||
| 167 | day_array(month, year, dp); | 167 | day_array(month, year, dp); |
| 168 | len = sprintf(lineout, "%s %d", month_names[month - 1], year); | 168 | len = sprintf(lineout, "%s %d", month_names[month - 1], year); |
| 169 | printf("%*s%s\n%s\n", | 169 | printf("%*s%s\n%s\n", |
| 170 | ((7*julian + WEEK_LEN) - len) / 2, "", | 170 | ((7*julian + WEEK_LEN) - len) / 2, "", |
| 171 | lineout, day_headings); | 171 | lineout, day_headings); |
| 172 | for (row = 0; row < 6; row++) { | 172 | for (row = 0; row < 6; row++) { |
| 173 | build_row(lineout, dp)[0] = '\0'; | 173 | build_row(lineout, dp)[0] = '\0'; |
| 174 | dp += 7; | 174 | dp += 7; |
| @@ -181,10 +181,11 @@ int cal_main(int argc UNUSED_PARAM, char **argv) | |||
| 181 | 181 | ||
| 182 | sprintf(lineout, "%u", year); | 182 | sprintf(lineout, "%u", year); |
| 183 | center(lineout, | 183 | center(lineout, |
| 184 | (WEEK_LEN * 3 + HEAD_SEP * 2) | 184 | (WEEK_LEN * 3 + HEAD_SEP * 2) |
| 185 | + julian * (J_WEEK_LEN * 2 + HEAD_SEP | 185 | + julian * (J_WEEK_LEN * 2 + HEAD_SEP |
| 186 | - (WEEK_LEN * 3 + HEAD_SEP * 2)), | 186 | - (WEEK_LEN * 3 + HEAD_SEP * 2)), |
| 187 | 0); | 187 | 0 |
| 188 | ); | ||
| 188 | puts("\n"); /* two \n's */ | 189 | puts("\n"); /* two \n's */ |
| 189 | for (i = 0; i < 12; i++) { | 190 | for (i = 0; i < 12; i++) { |
| 190 | day_array(i + 1, year, days[i]); | 191 | day_array(i + 1, year, days[i]); |
diff --git a/coreutils/chown.c b/coreutils/chown.c index bb166d8fe..1a9127622 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c | |||
| @@ -126,8 +126,8 @@ int chown_main(int argc UNUSED_PARAM, char **argv) | |||
| 126 | /* This matches coreutils behavior (almost - see below) */ | 126 | /* This matches coreutils behavior (almost - see below) */ |
| 127 | param.chown_func = chown; | 127 | param.chown_func = chown; |
| 128 | if (OPT_NODEREF | 128 | if (OPT_NODEREF |
| 129 | /* || (OPT_RECURSE && !OPT_TRAVERSE_TOP): */ | 129 | /* || (OPT_RECURSE && !OPT_TRAVERSE_TOP): */ |
| 130 | IF_DESKTOP( || (opt & (BIT_RECURSE|BIT_TRAVERSE_TOP)) == BIT_RECURSE) | 130 | IF_DESKTOP( || (opt & (BIT_RECURSE|BIT_TRAVERSE_TOP)) == BIT_RECURSE) |
| 131 | ) { | 131 | ) { |
| 132 | param.chown_func = lchown; | 132 | param.chown_func = lchown; |
| 133 | } | 133 | } |
diff --git a/coreutils/cut.c b/coreutils/cut.c index 2c27b704f..84449c775 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
| @@ -212,7 +212,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv) | |||
| 212 | if (opt & CUT_OPT_SUPPRESS_FLGS) { | 212 | if (opt & CUT_OPT_SUPPRESS_FLGS) { |
| 213 | bb_error_msg_and_die | 213 | bb_error_msg_and_die |
| 214 | ("suppressing non-delimited lines makes sense%s", | 214 | ("suppressing non-delimited lines makes sense%s", |
| 215 | _op_on_field); | 215 | _op_on_field); |
| 216 | } | 216 | } |
| 217 | if (delim != '\t') { | 217 | if (delim != '\t') { |
| 218 | bb_error_msg_and_die | 218 | bb_error_msg_and_die |
diff --git a/coreutils/df.c b/coreutils/df.c index 63dbd61bd..5e9a8670f 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
| @@ -110,9 +110,9 @@ int df_main(int argc UNUSED_PARAM, char **argv) | |||
| 110 | df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */ | 110 | df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */ |
| 111 | 111 | ||
| 112 | /* From the manpage of df from coreutils-6.10: | 112 | /* From the manpage of df from coreutils-6.10: |
| 113 | Disk space is shown in 1K blocks by default, unless the environment | 113 | * Disk space is shown in 1K blocks by default, unless the environment |
| 114 | variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. | 114 | * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. |
| 115 | */ | 115 | */ |
| 116 | if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ | 116 | if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ |
| 117 | df_disp_hr = 512; | 117 | df_disp_hr = 512; |
| 118 | 118 | ||
| @@ -221,7 +221,7 @@ int df_main(int argc UNUSED_PARAM, char **argv) | |||
| 221 | } | 221 | } |
| 222 | #else | 222 | #else |
| 223 | if (printf("\n%-20s" + 1, device) > 20 && !(opt & OPT_POSIX)) | 223 | if (printf("\n%-20s" + 1, device) > 20 && !(opt & OPT_POSIX)) |
| 224 | printf("\n%-20s", ""); | 224 | printf("\n%-20s", ""); |
| 225 | #endif | 225 | #endif |
| 226 | 226 | ||
| 227 | #if ENABLE_FEATURE_HUMAN_READABLE | 227 | #if ENABLE_FEATURE_HUMAN_READABLE |
diff --git a/coreutils/du.c b/coreutils/du.c index 04e78f982..05f114cc5 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
| @@ -89,6 +89,10 @@ struct globals { | |||
| 89 | #define INIT_G() do { } while (0) | 89 | #define INIT_G() do { } while (0) |
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | /* FIXME? coreutils' du rounds sizes up: | ||
| 93 | * for example, 1025k file is shown as "2" by du -m. | ||
| 94 | * We round to nearest. | ||
| 95 | */ | ||
| 92 | static void print(unsigned long long size, const char *filename) | 96 | static void print(unsigned long long size, const char *filename) |
| 93 | { | 97 | { |
| 94 | /* TODO - May not want to defer error checking here. */ | 98 | /* TODO - May not want to defer error checking here. */ |
diff --git a/coreutils/id.c b/coreutils/id.c index 399d25e34..1f20b755e 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
| @@ -174,7 +174,7 @@ int id_main(int argc UNUSED_PARAM, char **argv) | |||
| 174 | /* Don't allow -n -r -nr -ug -rug -nug -rnug -uZ -gZ -GZ*/ | 174 | /* Don't allow -n -r -nr -ug -rug -nug -rnug -uZ -gZ -GZ*/ |
| 175 | /* Don't allow more than one username */ | 175 | /* Don't allow more than one username */ |
| 176 | opt_complementary = "?1:u--g:g--u:G--u:u--G:g--G:G--g:r?ugG:n?ugG" | 176 | opt_complementary = "?1:u--g:g--u:G--u:u--G:g--G:G--g:r?ugG:n?ugG" |
| 177 | IF_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G"); | 177 | IF_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G"); |
| 178 | opt = getopt32(argv, "rnugG" IF_SELINUX("Z")); | 178 | opt = getopt32(argv, "rnugG" IF_SELINUX("Z")); |
| 179 | } | 179 | } |
| 180 | 180 | ||
diff --git a/coreutils/ls.c b/coreutils/ls.c index 4fe291d17..2c5fda96a 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
| @@ -260,7 +260,7 @@ enum { | |||
| 260 | 260 | ||
| 261 | /* TODO: simple toggles may be stored as OPT_xxx bits instead */ | 261 | /* TODO: simple toggles may be stored as OPT_xxx bits instead */ |
| 262 | static const uint32_t opt_flags[] = { | 262 | static const uint32_t opt_flags[] = { |
| 263 | STYLE_COLUMNAR, /* C */ | 263 | STYLE_COLUMNAR, /* C */ |
| 264 | DISP_HIDDEN | DISP_DOT, /* a */ | 264 | DISP_HIDDEN | DISP_DOT, /* a */ |
| 265 | DISP_NOLIST, /* d */ | 265 | DISP_NOLIST, /* d */ |
| 266 | LIST_INO, /* i */ | 266 | LIST_INO, /* i */ |
| @@ -720,7 +720,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f | |||
| 720 | if ((option_mask32 & OPT_L) || force_follow) { | 720 | if ((option_mask32 & OPT_L) || force_follow) { |
| 721 | #if ENABLE_SELINUX | 721 | #if ENABLE_SELINUX |
| 722 | if (is_selinux_enabled()) { | 722 | if (is_selinux_enabled()) { |
| 723 | getfilecon(fullname, &cur->sid); | 723 | getfilecon(fullname, &cur->sid); |
| 724 | } | 724 | } |
| 725 | #endif | 725 | #endif |
| 726 | if (stat(fullname, &statbuf)) { | 726 | if (stat(fullname, &statbuf)) { |
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index 2cb6dd43c..92a4d4462 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c | |||
| @@ -55,6 +55,16 @@ | |||
| 55 | //usage: "\n -s Don't output anything, status code shows success" | 55 | //usage: "\n -s Don't output anything, status code shows success" |
| 56 | //usage: "\n -w Warn about improperly formatted checksum lines" | 56 | //usage: "\n -w Warn about improperly formatted checksum lines" |
| 57 | //usage: ) | 57 | //usage: ) |
| 58 | //usage: | ||
| 59 | //usage:#define sha3sum_trivial_usage | ||
| 60 | //usage: IF_FEATURE_MD5_SHA1_SUM_CHECK("[-c[sw]] ")"[FILE]..." | ||
| 61 | //usage:#define sha3sum_full_usage "\n\n" | ||
| 62 | //usage: "Print" IF_FEATURE_MD5_SHA1_SUM_CHECK(" or check") " SHA3-512 checksums" | ||
| 63 | //usage: IF_FEATURE_MD5_SHA1_SUM_CHECK( "\n" | ||
| 64 | //usage: "\n -c Check sums against list in FILEs" | ||
| 65 | //usage: "\n -s Don't output anything, status code shows success" | ||
| 66 | //usage: "\n -w Warn about improperly formatted checksum lines" | ||
| 67 | //usage: ) | ||
| 58 | 68 | ||
| 59 | #include "libbb.h" | 69 | #include "libbb.h" |
| 60 | 70 | ||
| @@ -65,6 +75,7 @@ enum { | |||
| 65 | HASH_MD5 = 's', /* "md5>s<um" */ | 75 | HASH_MD5 = 's', /* "md5>s<um" */ |
| 66 | HASH_SHA1 = '1', | 76 | HASH_SHA1 = '1', |
| 67 | HASH_SHA256 = '2', | 77 | HASH_SHA256 = '2', |
| 78 | HASH_SHA3 = '3', | ||
| 68 | HASH_SHA512 = '5', | 79 | HASH_SHA512 = '5', |
| 69 | }; | 80 | }; |
| 70 | 81 | ||
| @@ -86,6 +97,7 @@ static uint8_t *hash_file(const char *filename) | |||
| 86 | { | 97 | { |
| 87 | int src_fd, hash_len, count; | 98 | int src_fd, hash_len, count; |
| 88 | union _ctx_ { | 99 | union _ctx_ { |
| 100 | sha3_ctx_t sha3; | ||
| 89 | sha512_ctx_t sha512; | 101 | sha512_ctx_t sha512; |
| 90 | sha256_ctx_t sha256; | 102 | sha256_ctx_t sha256; |
| 91 | sha1_ctx_t sha1; | 103 | sha1_ctx_t sha1; |
| @@ -124,6 +136,11 @@ static uint8_t *hash_file(const char *filename) | |||
| 124 | update = (void*)sha512_hash; | 136 | update = (void*)sha512_hash; |
| 125 | final = (void*)sha512_end; | 137 | final = (void*)sha512_end; |
| 126 | hash_len = 64; | 138 | hash_len = 64; |
| 139 | } else if (ENABLE_SHA3SUM && hash_algo == HASH_SHA3) { | ||
| 140 | sha3_begin(&context.sha3); | ||
| 141 | update = (void*)sha3_hash; | ||
| 142 | final = (void*)sha3_end; | ||
| 143 | hash_len = 64; | ||
| 127 | } else { | 144 | } else { |
| 128 | xfunc_die(); /* can't reach this */ | 145 | xfunc_die(); /* can't reach this */ |
| 129 | } | 146 | } |
| @@ -223,7 +240,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv) | |||
| 223 | } | 240 | } |
| 224 | if (count_failed && !(flags & FLAG_SILENT)) { | 241 | if (count_failed && !(flags & FLAG_SILENT)) { |
| 225 | bb_error_msg("WARNING: %d of %d computed checksums did NOT match", | 242 | bb_error_msg("WARNING: %d of %d computed checksums did NOT match", |
| 226 | count_failed, count_total); | 243 | count_failed, count_total); |
| 227 | } | 244 | } |
| 228 | fclose_if_not_stdin(pre_computed_stream); | 245 | fclose_if_not_stdin(pre_computed_stream); |
| 229 | } else { | 246 | } else { |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 32d3659ac..aa0450481 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
| @@ -59,7 +59,7 @@ int mknod_main(int argc, char **argv) | |||
| 59 | /* Autodetect what the system supports; these macros should | 59 | /* Autodetect what the system supports; these macros should |
| 60 | * optimize out to two constants. */ | 60 | * optimize out to two constants. */ |
| 61 | dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)), | 61 | dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)), |
| 62 | xatoul_range(argv[3], 0, minor(UINT_MAX))); | 62 | xatoul_range(argv[3], 0, minor(UINT_MAX))); |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | 65 | ||
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 7a6f22b03..ee4f72ca1 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
| @@ -1028,12 +1028,12 @@ dump(off_t current_offset, off_t end_offset) | |||
| 1028 | l_c_m = get_lcm(); | 1028 | l_c_m = get_lcm(); |
| 1029 | 1029 | ||
| 1030 | /* Make bytes_to_write the smallest multiple of l_c_m that | 1030 | /* Make bytes_to_write the smallest multiple of l_c_m that |
| 1031 | is at least as large as n_bytes_read. */ | 1031 | is at least as large as n_bytes_read. */ |
| 1032 | bytes_to_write = l_c_m * ((n_bytes_read + l_c_m - 1) / l_c_m); | 1032 | bytes_to_write = l_c_m * ((n_bytes_read + l_c_m - 1) / l_c_m); |
| 1033 | 1033 | ||
| 1034 | memset(block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read); | 1034 | memset(block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read); |
| 1035 | write_block(current_offset, bytes_to_write, | 1035 | write_block(current_offset, bytes_to_write, |
| 1036 | block[idx ^ 1], block[idx]); | 1036 | block[idx ^ 1], block[idx]); |
| 1037 | current_offset += n_bytes_read; | 1037 | current_offset += n_bytes_read; |
| 1038 | } | 1038 | } |
| 1039 | 1039 | ||
diff --git a/coreutils/sort.c b/coreutils/sort.c index 1df07285c..a1625fc9c 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
| @@ -219,7 +219,7 @@ static int compare_keys(const void *xarg, const void *yarg) | |||
| 219 | y = get_key(*(char **)yarg, key, flags); | 219 | y = get_key(*(char **)yarg, key, flags); |
| 220 | #else | 220 | #else |
| 221 | /* This curly bracket serves no purpose but to match the nesting | 221 | /* This curly bracket serves no purpose but to match the nesting |
| 222 | level of the for () loop we're not using */ | 222 | * level of the for () loop we're not using */ |
| 223 | { | 223 | { |
| 224 | x = *(char **)xarg; | 224 | x = *(char **)xarg; |
| 225 | y = *(char **)yarg; | 225 | y = *(char **)yarg; |
diff --git a/coreutils/stat.c b/coreutils/stat.c index 259481750..69a8a1a36 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
| @@ -611,37 +611,43 @@ static bool do_stat(const char *filename, const char *format) | |||
| 611 | # else | 611 | # else |
| 612 | if (option_mask32 & OPT_TERSE) { | 612 | if (option_mask32 & OPT_TERSE) { |
| 613 | format = (option_mask32 & OPT_SELINUX ? | 613 | format = (option_mask32 & OPT_SELINUX ? |
| 614 | "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n": | 614 | "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n" |
| 615 | "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n"); | 615 | : |
| 616 | "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n" | ||
| 617 | ); | ||
| 616 | } else { | 618 | } else { |
| 617 | if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) { | 619 | if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) { |
| 618 | format = (option_mask32 & OPT_SELINUX ? | 620 | format = (option_mask32 & OPT_SELINUX ? |
| 619 | " File: %N\n" | 621 | " File: %N\n" |
| 620 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" | 622 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" |
| 621 | "Device: %Dh/%dd\tInode: %-10i Links: %-5h" | 623 | "Device: %Dh/%dd\tInode: %-10i Links: %-5h" |
| 622 | " Device type: %t,%T\n" | 624 | " Device type: %t,%T\n" |
| 623 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" | 625 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" |
| 624 | " S_Context: %C\n" | 626 | " S_Context: %C\n" |
| 625 | "Access: %x\n" "Modify: %y\n" "Change: %z\n": | 627 | "Access: %x\n" "Modify: %y\n" "Change: %z\n" |
| 626 | " File: %N\n" | 628 | : |
| 627 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" | 629 | " File: %N\n" |
| 628 | "Device: %Dh/%dd\tInode: %-10i Links: %-5h" | 630 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" |
| 629 | " Device type: %t,%T\n" | 631 | "Device: %Dh/%dd\tInode: %-10i Links: %-5h" |
| 630 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" | 632 | " Device type: %t,%T\n" |
| 631 | "Access: %x\n" "Modify: %y\n" "Change: %z\n"); | 633 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" |
| 634 | "Access: %x\n" "Modify: %y\n" "Change: %z\n" | ||
| 635 | ); | ||
| 632 | } else { | 636 | } else { |
| 633 | format = (option_mask32 & OPT_SELINUX ? | 637 | format = (option_mask32 & OPT_SELINUX ? |
| 634 | " File: %N\n" | 638 | " File: %N\n" |
| 635 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" | 639 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" |
| 636 | "Device: %Dh/%dd\tInode: %-10i Links: %h\n" | 640 | "Device: %Dh/%dd\tInode: %-10i Links: %h\n" |
| 637 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" | 641 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" |
| 638 | "S_Context: %C\n" | 642 | "S_Context: %C\n" |
| 639 | "Access: %x\n" "Modify: %y\n" "Change: %z\n": | 643 | "Access: %x\n" "Modify: %y\n" "Change: %z\n" |
| 640 | " File: %N\n" | 644 | : |
| 641 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" | 645 | " File: %N\n" |
| 642 | "Device: %Dh/%dd\tInode: %-10i Links: %h\n" | 646 | " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" |
| 643 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" | 647 | "Device: %Dh/%dd\tInode: %-10i Links: %h\n" |
| 644 | "Access: %x\n" "Modify: %y\n" "Change: %z\n"); | 648 | "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" |
| 649 | "Access: %x\n" "Modify: %y\n" "Change: %z\n" | ||
| 650 | ); | ||
| 645 | } | 651 | } |
| 646 | } | 652 | } |
| 647 | # endif | 653 | # endif |
diff --git a/coreutils/stty.c b/coreutils/stty.c index 0668cf7be..96754dd84 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
| @@ -1056,7 +1056,7 @@ static void do_display(const struct termios *mode, int all) | |||
| 1056 | } | 1056 | } |
| 1057 | #endif | 1057 | #endif |
| 1058 | wrapf("%s = %s;", nth_string(control_name, i), | 1058 | wrapf("%s = %s;", nth_string(control_name, i), |
| 1059 | visible(mode->c_cc[control_info[i].offset])); | 1059 | visible(mode->c_cc[control_info[i].offset])); |
| 1060 | } | 1060 | } |
| 1061 | #if VEOF == VMIN | 1061 | #if VEOF == VMIN |
| 1062 | if ((mode->c_lflag & ICANON) == 0) | 1062 | if ((mode->c_lflag & ICANON) == 0) |
diff --git a/coreutils/sum.c b/coreutils/sum.c index 95110a6da..75f6ef60a 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c | |||
| @@ -94,8 +94,8 @@ int sum_main(int argc UNUSED_PARAM, char **argv) | |||
| 94 | n = sum_file("-", type); | 94 | n = sum_file("-", type); |
| 95 | } else { | 95 | } else { |
| 96 | /* Need to print the name if either | 96 | /* Need to print the name if either |
| 97 | - more than one file given | 97 | * - more than one file given |
| 98 | - doing sysv */ | 98 | * - doing sysv */ |
| 99 | type += (argv[1] || type == SUM_SYSV); | 99 | type += (argv[1] || type == SUM_SYSV); |
| 100 | n = 1; | 100 | n = 1; |
| 101 | do { | 101 | do { |
diff --git a/coreutils/test.c b/coreutils/test.c index 80f540c22..d8af4dcf3 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
| @@ -610,7 +610,7 @@ static int test_eaccess(char *path, int mode) | |||
| 610 | return 0; | 610 | return 0; |
| 611 | 611 | ||
| 612 | /* Root can execute any file that has any one of the execute | 612 | /* Root can execute any file that has any one of the execute |
| 613 | bits set. */ | 613 | * bits set. */ |
| 614 | if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) | 614 | if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) |
| 615 | return 0; | 615 | return 0; |
| 616 | } | 616 | } |
