X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.c;h=2465e16a3da6c9b0fcf1801a2ba25861a03f5834;hp=ba5ba831a01745e5fc13df64edce7d9fb9f20909;hb=c37b1bdf2d871a11672772f83080f3ea9bda1b17;hpb=c771eaf362edb021888d114989d38d8fb2b4cfb3 diff --git a/notmuch.c b/notmuch.c index ba5ba831..2465e16a 100644 --- a/notmuch.c +++ b/notmuch.c @@ -770,7 +770,7 @@ _format_relative_date (void *ctx, time_t then) if (delta > 180 * DAY) { strftime (result, RELATIVE_DATE_MAX, - "%F", &tm_then); + "%F", &tm_then); /* 2008-06-30 */ return result; } @@ -780,24 +780,26 @@ _format_relative_date (void *ctx, time_t then) return result; } - if (delta <= 6 * DAY) { + if (delta <= 7 * DAY) { if (tm_then.tm_wday == tm_now.tm_wday && delta < DAY) { strftime (result, RELATIVE_DATE_MAX, - "%R", &tm_then); + "%R", &tm_then); /* 12:30 */ return result; } else if ((tm_now.tm_wday + 7 - tm_then.tm_wday) % 7 == 1) { return "Yesterday"; } else { - strftime (result, RELATIVE_DATE_MAX, - "%A", &tm_then); - return result; + if (tm_then.tm_wday != tm_now.tm_wday) { + strftime (result, RELATIVE_DATE_MAX, + "%A", &tm_then); /* Monday */ + return result; + } } } strftime (result, RELATIVE_DATE_MAX, - "%b %d", &tm_then); + "%b %d", &tm_then); /* Oct. 12 */ return result; } #undef MINUTE @@ -1448,8 +1450,8 @@ main (int argc, char *argv[]) /* Don't complain about "help" being an unknown command when we're about to provide exactly what's wanted anyway. */ - fprintf (stderr, "Error: Unknown command '%s'\n\n", argv[1]); - usage (); + fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n", + argv[1]); return 1; }