diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-03-21 15:13:50 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-03-21 15:13:50 +0000 |
| commit | b4e3ab4a9cbe30df8746609013738e4234335fb1 (patch) | |
| tree | 96a3d9b059a007a12c12c16b7c398ae07218af35 /gnu | |
| parent | 0aef91a149b780c368b25d6eb7d258788e35aab4 (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/tar/list.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gnu/usr.bin/tar/list.c b/gnu/usr.bin/tar/list.c index a3329c9c2bee..911170be7877 100644 --- a/gnu/usr.bin/tar/list.c +++ b/gnu/usr.bin/tar/list.c @@ -15,7 +15,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Tar; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +$FreeBSD$ + +*/ /* * List a tar archive. @@ -29,6 +33,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ctype.h> #include <sys/types.h> #include <errno.h> +#include <langinfo.h> #ifndef STDC_HEADERS extern int errno; #endif @@ -564,6 +569,7 @@ print_header () char size[24]; /* Holds a formatted long or maj, min */ time_t longie; int pad; + static int d_first = -1; char *name; extern long baserec; @@ -640,10 +646,12 @@ print_header () demode ((unsigned) hstat.st_mode, modes + 1); /* Timestamp */ + if (d_first < 0) + d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); longie = hstat.st_mtime; - strftime(timestamp, sizeof(timestamp), "%c", localtime(&longie)); - timestamp[16] = '\0'; - timestamp[24] = '\0'; + strftime(timestamp, sizeof(timestamp), + d_first ? "%e %b %H:%M %Y" : "%b %e %H:%M %Y", + localtime(&longie)); /* User and group names */ if (*head->header.uname && head_standard) @@ -694,14 +702,14 @@ print_header () name = quote_copy_string (current_file_name); if (!name) name = current_file_name; - fprintf (msg_file, "%s %s/%s %*s%s %s %s %s", + fprintf (msg_file, "%s %s/%s %*s%s %s %s", modes, user, group, ugswidth - pad, "", size, - timestamp + 4, timestamp + 20, + timestamp, name); if (name != current_file_name) |
