cpio.c (e64fe029e9d3ce476e77a478318e0c3cd201ff08) cpio.c (64884e0d4ce7ed57c970e1b34f93e3754c656900)
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 1132 unchanged lines hidden (view full) ---

1141 * listing additional information in an "unspecified format,"
1142 * and 'pax -l' is documented as using the same format as 'ls -l'.
1143 */
1144static void
1145list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
1146{
1147 char size[32];
1148 char date[32];
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 1132 unchanged lines hidden (view full) ---

1141 * listing additional information in an "unspecified format,"
1142 * and 'pax -l' is documented as using the same format as 'ls -l'.
1143 */
1144static void
1145list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
1146{
1147 char size[32];
1148 char date[32];
1149 char uids[16], gids[16];
1149 char uids[22], gids[22];
1150 const char *uname, *gname;
1151 FILE *out = stdout;
1152 const char *fmt;
1153 time_t mtime;
1154 static time_t now;
1155 struct tm *ltime;
1156#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
1157 struct tm tmbuf;

--- 47 unchanged lines hidden (view full) ---

1205#endif
1206#if defined(HAVE_LOCALTIME_S)
1207 ltime = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf;
1208#elif defined(HAVE_LOCALTIME_R)
1209 ltime = localtime_r(&mtime, &tmbuf);
1210#else
1211 ltime = localtime(&mtime);
1212#endif
1150 const char *uname, *gname;
1151 FILE *out = stdout;
1152 const char *fmt;
1153 time_t mtime;
1154 static time_t now;
1155 struct tm *ltime;
1156#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
1157 struct tm tmbuf;

--- 47 unchanged lines hidden (view full) ---

1205#endif
1206#if defined(HAVE_LOCALTIME_S)
1207 ltime = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf;
1208#elif defined(HAVE_LOCALTIME_R)
1209 ltime = localtime_r(&mtime, &tmbuf);
1210#else
1211 ltime = localtime(&mtime);
1212#endif
1213 strftime(date, sizeof(date), fmt, ltime);
1213 if (ltime != NULL)
1214 strftime(date, sizeof(date), fmt, ltime);
1215 else
1216 strcpy(date, "invalid mtime");
1214
1215 fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
1216 archive_entry_strmode(entry),
1217 archive_entry_nlink(entry),
1218 uname, gname, size, date,
1219 archive_entry_pathname(entry));
1220
1221 /* Extra information for links. */

--- 289 unchanged lines hidden ---
1217
1218 fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
1219 archive_entry_strmode(entry),
1220 archive_entry_nlink(entry),
1221 uname, gname, size, date,
1222 archive_entry_pathname(entry));
1223
1224 /* Extra information for links. */

--- 289 unchanged lines hidden ---