Re: last: please review -F and --time-format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 12 May 2014, Karel Zak wrote:
> On Thu, May 08, 2014 at 10:26:36PM +0200, Ruediger Meier wrote:
> > That's a bit ugly to fix without more refactoring. I've tried here
> > to address both issues:
> > https://github.com/karelzak/util-linux/pull/73
>
>  Merged, but note that code like:
>
>    if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME)
>
>  is fragile (as someone can modify LAST_TIMEFTM_* enum), it would be
>  better to introduce any macro and keep it near to LAST_TIMEFTM_*
>  definitions or fix the problem in a better way.

Yes, my first version of that patch had hardcoded

   if (timefmts[ctl->time_fmt].out > 7)

because the particular strings in these if statements really require "7" 
and nothing else. But then I've notived that the whole thing explodes 
anyway if somebody would change fmt values.

cu,
Rudi
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux