aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-28 04:00:09 -0500
committerB. Watson <urchlay@slackware.uk>2025-11-28 04:00:09 -0500
commit0861fc6fc6614084bad79db36eeae4eefd75ff9e (patch)
tree5a0da9bdecd73ccc0863766e0f5a0235f20d9bd9
parent557f14c7abf3f72fc3b2f70c1402acde5a4d524f (diff)
downloadalftools-0861fc6fc6614084bad79db36eeae4eefd75ff9e.tar.gz
alf: store seconds in timestamp. unalf: display seconds with -v.
-rw-r--r--src/alf.c2
-rw-r--r--src/listalf.c10
-rw-r--r--src/unalf.rst2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/alf.c b/src/alf.c
index 234b169..49e69c2 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -144,7 +144,7 @@ unsigned long get_msdos_date_time(void) {
msdos_year = tm->tm_year + 1900 - 1980;
ms_date = tm->tm_mday | (tm->tm_mon << 5) | (msdos_year << 9);
- ms_time = (tm->tm_min << 5) | (tm->tm_hour << 11);
+ ms_time = (tm->tm_sec >> 1) | (tm->tm_min << 5) | (tm->tm_hour << 11);
return ms_date | (ms_time << 16);
}
diff --git a/src/listalf.c b/src/listalf.c
index 8082d11..21aef79 100644
--- a/src/listalf.c
+++ b/src/listalf.c
@@ -19,12 +19,12 @@ unsigned int getquad(int offs) {
/* see Arcinfo for details */
void format_msdos_time(char *buf) {
- u16 t, hour, min;
+ u16 t, hour, min, sec;
char ampm;
t = getword(alf_hdr_time0);
- /* don't bother with seconds (arc doesn't print them either) */
+ sec = (t & 0x1f) << 1;
hour = t >> 11;
min = (t >> 5) & 0x3f;
@@ -37,7 +37,7 @@ void format_msdos_time(char *buf) {
/* midnight and noon print as 12, not 0 */
if(hour == 0) hour = 12;
- snprintf(buf, 7, "%2d:%02d%c", hour, min, ampm);
+ snprintf(buf, 10, "%2d:%02d:%02d%c", hour, min, sec, ampm);
}
/* see Arcinfo for details */
@@ -76,8 +76,8 @@ void list_alf(void) {
extern char *out_filename;
if(opts.verbose_list) {
- puts("Name Length Size now Comp Date Time CkSum");
- puts("============ ======== ======== ==== ========= ====== =====");
+ puts("Name Length Size now Comp Date Time CkSum");
+ puts("============ ======== ======== ==== ========= ========= =====");
}
while(read_alf_header()) {
diff --git a/src/unalf.rst b/src/unalf.rst
index e94fc21..1c04c3b 100644
--- a/src/unalf.rst
+++ b/src/unalf.rst
@@ -155,7 +155,7 @@ OPTIONS
output format is similar to that of **arc -v**, minus the *Stowage*
column, since *ALF* doesn't support multiple compression types. The
date and time are displayed, but in most .alf files these are the
- default values of "8 Jan 82 12:24a".
+ default values of "8 Jan 82 12:24:38a".
Unlike **-l**, the **-v** listing shows the filenames exactly as
stored in the archive (ignores **-L**, enables **-k**), and always