X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=f14440e6fb903548e25ccfdf611f4c2f2881aa49;hp=f5830dacd0ce98836380bd89dcc5a28cc29cbd45;hb=33692c33f2effa9620064aec44c6196a8d830d05;hpb=75695bba841fc43094ebc669418187080cea00e6 diff --git a/aft.c b/aft.c index f5830dac..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; } @@ -2401,6 +2407,7 @@ static int com_setatt_callback(struct afs_callback_arg *aca) ) { char c; unsigned char bitnum; + uint64_t one = 1; len = strlen(p); ret = -E_ATTR_SYNTAX; @@ -2416,9 +2423,9 @@ static int com_setatt_callback(struct afs_callback_arg *aca) goto out; } if (c == '+') - cad.add_mask |= (1UL << bitnum); + cad.add_mask |= (one << bitnum); else - cad.del_mask |= (1UL << bitnum); + cad.del_mask |= (one << bitnum); } ret = -E_ATTR_SYNTAX; if (!cad.add_mask && !cad.del_mask)