diff -urp fileutils-4.1.7.orig/configure.ac fileutils-4.1.7-ls-author/configure.ac --- fileutils-4.1.7.orig/configure.ac Sun Mar 31 08:10:32 2002 +++ fileutils-4.1.7-ls-author/configure.ac Sun Mar 31 08:11:04 2002 @@ -45,6 +45,8 @@ if test $fu_cv_sys_truncating_statfs = y fi AC_MSG_RESULT($fu_cv_sys_truncating_statfs) +AC_CHECK_MEMBERS([struct stat.st_author]) + jm_LIB_CHECK AM_GNU_GETTEXT diff -urp fileutils-4.1.7.orig/src/ls.c fileutils-4.1.7-ls-author/src/ls.c --- fileutils-4.1.7.orig/src/ls.c Sun Mar 31 08:10:32 2002 +++ fileutils-4.1.7-ls-author/src/ls.c Tue Apr 2 19:07:30 2002 @@ -461,6 +461,11 @@ static int sort_reverse; static int print_owner = 1; +#if HAVE_STRUCT_STAT_ST_AUTHOR +/* Nonzero means to display author information.*/ +static int print_author = 0; +#endif + /* Nonzero means to display group information. -G and -o turn this off. */ static int print_group = 1; @@ -707,6 +712,9 @@ enum SI_OPTION, SORT_OPTION, TIME_OPTION, +#if HAVE_STRUCT_STAT_ST_AUTHOR + AUTHOR_OPTION, +#endif TIME_STYLE_OPTION }; @@ -747,6 +755,9 @@ static struct option const long_options[ {"time-style", required_argument, 0, TIME_STYLE_OPTION}, {"color", optional_argument, 0, COLOR_OPTION}, {"block-size", required_argument, 0, BLOCK_SIZE_OPTION}, +#if HAVE_STRUCT_STAT_ST_AUTHOR + {"author", no_argument, 0, AUTHOR_OPTION}, +#endif {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} @@ -1494,6 +1505,13 @@ decode_switches (int argc, char **argv) format = one_per_line; break; +#if HAVE_STRUCT_STAT_ST_AUTHOR + case AUTHOR_OPTION: + format = long_format; + print_author = 1; + break; +#endif + case SORT_OPTION: sort_type = XARGMATCH ("--sort", optarg, sort_args, sort_types); sort_type_specified = 1; @@ -2834,6 +2852,19 @@ print_long_format (const struct fileinfo p += strlen (p); } +#if HAVE_STRUCT_STAT_ST_AUTHOR + if (print_author) + { + char const *author_name = + (numeric_ids ? NULL : getuser (f->stat.st_author)); + if (author_name) + sprintf (p, "%-8s ", author_name); + else + sprintf (p, "%-8lu ", (unsigned long) f->stat.st_author); + p += strlen (p); + } +#endif + if (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode)) sprintf (p, "%3lu, %3lu ", (unsigned long) major (f->stat.st_rdev), @@ -3586,6 +3617,11 @@ Mandatory arguments to long options are -A, --almost-all do not list implied . and ..\n\ -b, --escape print octal escapes for nongraphic characters\n\ "), stdout); +#if HAVE_STRUCT_STAT_ST_AUTHOR + fputs(_("\ + --author print the author of each file\n\ +"), stdout); +#endif fputs (_("\ --block-size=SIZE use SIZE-byte blocks\n\ -B, --ignore-backups do not list implied entries ending with ~\n\