[PATCH 2/2] Add '-l / --last-arg' to herbstclient
Florian Schmaus
flo at geekplace.eu
Mon Jun 30 12:09:37 CEST 2014
On Mon, Jun 30, 2014 at 11:55 AM, Thorsten Wißmann <edu at thorsten-wissmann.de
> wrote:
> Hi,
>
> On Wed, Jun 25, 2014 at 01:09:44PM +0200, Florian Schmaus wrote:
> > if (print_signal) {
> > - // just print as list
> > - for (int i = 0; i < hook_argc; i++) {
> > - printf("%s%s", i ? "\t" : "", hook_argv[i]);
> > + if (g_print_last_arg_only) {
> > + // This assumes that hook_argc is always > 0!
> > + printf("%s", hook_argv[hook_argc-1]);
> > + } else {
>
> Don't assume it, check it :). I've just added a check for it such that
> "empty" hooks are simply dropped.
>
I figured you would guarantee it. :) But of course, checking the
preconditions is always a
good idea!
Best,
Florian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140630/8719e00f/attachment.htm>
More information about the hlwm
mailing list