From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: kerolasa@gmail.com, "util-linux" <util-linux@vger.kernel.org>
Subject: Re: last: please review -F and --time-format
Date: Mon, 12 May 2014 13:01:02 +0200 [thread overview]
Message-ID: <201405121301.02972.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20140512102510.GB8951@x2.net.home>
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
prev parent reply other threads:[~2014-05-12 11:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 14:31 last: please review -F and --time-format Ruediger Meier
2014-05-08 8:46 ` Sami Kerola
2014-05-08 20:26 ` Ruediger Meier
2014-05-12 10:25 ` Karel Zak
2014-05-12 11:01 ` Ruediger Meier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201405121301.02972.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=kerolasa@gmail.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox