LIST_INO, /* i */
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
LIST_SHORT | STYLE_SINGLE, /* 1 */
- 0, /* g (don't show group) - handled via OPT_g */
+ 0, /* g (don't show owner) - handled via OPT_g */
LIST_ID_NUMERIC, /* n */
LIST_BLOCKS, /* s */
DISP_ROWS, /* x */
if (all_fmt & LIST_ID_NAME) {
if (option_mask32 & OPT_g) {
column += printf("%-8.8s ",
- get_cached_username(dn->dstat.st_uid));
+ get_cached_groupname(dn->dstat.st_gid));
} else {
column += printf("%-8.8s %-8.8s ",
get_cached_username(dn->dstat.st_uid),
#endif
if (all_fmt & LIST_ID_NUMERIC) {
if (option_mask32 & OPT_g)
- column += printf("%-8u ", (int) dn->dstat.st_uid);
+ column += printf("%-8u ", (int) dn->dstat.st_gid);
else
column += printf("%-8u %-8u ",
(int) dn->dstat.st_uid,
#if ENABLE_FEATURE_SORT_BIG
/* Open output file _after_ we read all input ones */
if (option_mask32 & FLAG_o)
- xmove_fd(xopen3(str_o, O_WRONLY, 0666), STDOUT_FILENO);
+ xmove_fd(xopen3(str_o, O_WRONLY|O_CREAT|O_TRUNC, 0666), STDOUT_FILENO);
#endif
flag = (option_mask32 & FLAG_z) ? '\0' : '\n';
for (i = 0; i < linecount; i++)
query_len = strlen(query_string) + 1;
/* may be unaligned! */
unaligned_type_class = (void *)(query_string + query_len);
- query_len += sizeof(unaligned_type_class);
+ query_len += sizeof(*unaligned_type_class);
/* where to append answer block */
answb = (void *)(unaligned_type_class + 1);