diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/ls.c | 6 | ||||
-rw-r--r-- | coreutils/sort.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index 1197f7d71..07bb6af92 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -184,7 +184,7 @@ static const unsigned opt_flags[] = { | |||
184 | LIST_INO, /* i */ | 184 | LIST_INO, /* i */ |
185 | LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */ | 185 | LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */ |
186 | LIST_SHORT | STYLE_SINGLE, /* 1 */ | 186 | LIST_SHORT | STYLE_SINGLE, /* 1 */ |
187 | 0, /* g (don't show group) - handled via OPT_g */ | 187 | 0, /* g (don't show owner) - handled via OPT_g */ |
188 | LIST_ID_NUMERIC, /* n */ | 188 | LIST_ID_NUMERIC, /* n */ |
189 | LIST_BLOCKS, /* s */ | 189 | LIST_BLOCKS, /* s */ |
190 | DISP_ROWS, /* x */ | 190 | DISP_ROWS, /* x */ |
@@ -621,7 +621,7 @@ static NOINLINE unsigned list_single(const struct dnode *dn) | |||
621 | if (all_fmt & LIST_ID_NAME) { | 621 | if (all_fmt & LIST_ID_NAME) { |
622 | if (option_mask32 & OPT_g) { | 622 | if (option_mask32 & OPT_g) { |
623 | column += printf("%-8.8s ", | 623 | column += printf("%-8.8s ", |
624 | get_cached_username(dn->dstat.st_uid)); | 624 | get_cached_groupname(dn->dstat.st_gid)); |
625 | } else { | 625 | } else { |
626 | column += printf("%-8.8s %-8.8s ", | 626 | column += printf("%-8.8s %-8.8s ", |
627 | get_cached_username(dn->dstat.st_uid), | 627 | get_cached_username(dn->dstat.st_uid), |
@@ -631,7 +631,7 @@ static NOINLINE unsigned list_single(const struct dnode *dn) | |||
631 | #endif | 631 | #endif |
632 | if (all_fmt & LIST_ID_NUMERIC) { | 632 | if (all_fmt & LIST_ID_NUMERIC) { |
633 | if (option_mask32 & OPT_g) | 633 | if (option_mask32 & OPT_g) |
634 | column += printf("%-8u ", (int) dn->dstat.st_uid); | 634 | column += printf("%-8u ", (int) dn->dstat.st_gid); |
635 | else | 635 | else |
636 | column += printf("%-8u %-8u ", | 636 | column += printf("%-8u %-8u ", |
637 | (int) dn->dstat.st_uid, | 637 | (int) dn->dstat.st_uid, |
diff --git a/coreutils/sort.c b/coreutils/sort.c index 5c3fa1a71..237ac083c 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -412,7 +412,7 @@ int sort_main(int argc UNUSED_PARAM, char **argv) | |||
412 | #if ENABLE_FEATURE_SORT_BIG | 412 | #if ENABLE_FEATURE_SORT_BIG |
413 | /* Open output file _after_ we read all input ones */ | 413 | /* Open output file _after_ we read all input ones */ |
414 | if (option_mask32 & FLAG_o) | 414 | if (option_mask32 & FLAG_o) |
415 | xmove_fd(xopen3(str_o, O_WRONLY, 0666), STDOUT_FILENO); | 415 | xmove_fd(xopen3(str_o, O_WRONLY|O_CREAT|O_TRUNC, 0666), STDOUT_FILENO); |
416 | #endif | 416 | #endif |
417 | flag = (option_mask32 & FLAG_z) ? '\0' : '\n'; | 417 | flag = (option_mask32 & FLAG_z) ? '\0' : '\n'; |
418 | for (i = 0; i < linecount; i++) | 418 | for (i = 0; i < linecount; i++) |