From: Andre Noll Date: Mon, 4 Apr 2016 22:23:30 +0000 (+0200) Subject: Make dates in ls output align nicely again. X-Git-Tag: v0.5.6~39 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=02283cae11a26336ec94912e565200384356f324;ds=sidebyside Make dates in ls output align nicely again. Commit 3c978d34 "fixed" a whitespace issue by replacing two consecutive space characters in a format string by a single space. However, the duplicated space character actually had a purpose. This commit re-adds the additional space character and explains through a comment why it is needed. --- diff --git a/aft.c b/aft.c index 261054df..f14440e6 100644 --- a/aft.c +++ b/aft.c @@ -696,7 +696,13 @@ static int get_local_time(uint64_t *seconds, char *buf, size_t size, return -E_STRFTIME; return 1; } - if (!strftime(buf, size, "%b %e %Y", tm)) + /* + * If the given time is more than six month away from the current time, + * we print only the year. The additional space character in the format + * string below makes the formated date align nicely with dates that + * contain the time (those written by the above strftime() statement). + */ + if (!strftime(buf, size, "%b %e %Y", tm)) return -E_STRFTIME; return 1; }