Skip to content

Commit

Permalink
last: Format all lines, not just the "begins:" line
Browse files Browse the repository at this point in the history
  • Loading branch information
Nykseli committed Jan 3, 2024
1 parent e34c5a2 commit 3fe6f39
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions src/wtmpdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,37 @@ static int
time_format (const char *fmt)
{
if (strcmp (fmt, "notime") == 0)
return TIMEFMT_NOTIME;
{
login_fmt = TIMEFMT_NOTIME;
login_len = 0;
logout_fmt = TIMEFMT_NOTIME;
logout_len = 0;
return TIMEFMT_NOTIME;
}
if (strcmp (fmt, "short") == 0)
return TIMEFMT_SHORT;
{
login_fmt = TIMEFMT_SHORT;
login_len = 16;
logout_fmt = TIMEFMT_HHMM;
logout_len = 5;
return TIMEFMT_SHORT;
}
if (strcmp (fmt, "full") == 0)
return TIMEFMT_CTIME;
{
login_fmt = TIMEFMT_CTIME;
login_len = 24;
logout_fmt = TIMEFMT_CTIME;
logout_len = 24;
return TIMEFMT_CTIME;
}
if (strcmp (fmt, "iso") == 0)
return TIMEFMT_ISO;
{
login_fmt = TIMEFMT_ISO;
login_len = 25;
logout_fmt = TIMEFMT_ISO;
logout_len = 25;
return TIMEFMT_ISO;
}

return -1;
}
Expand Down

0 comments on commit 3fe6f39

Please sign in to comment.