Hi Florian, On Wed, Jun 25, 2014 at 11:33:52AM +0200, Florian Schmaus wrote: > *-n*, *--no-newline*:: > Do not print a newline if output does not end with a newline. > > +*-0*, *--print0*:: > + Use the null character as output delimiter. This option implies *-n*. That isn't stated quite clear in the man page (my mistake). The -n option only affects the mode of executing some hlwm command but not the mode of listening for hooks (So I have to fix this later). Furthermore, I don't know what an ouptut delimiter is: is it the delimiter between hooks or between the arguments of a hook? > + case '0': > + g_null_char_as_delim = true; > + // '-0' implies '-n' > + g_ensure_newline = 0; > + break; As stated above, g_ensure_newline never occurs in the hook-code, so we can just drop this. > - if (g_ensure_newline) { > + if (g_null_char_as_delim) { > + fputc(0, file); > + } else if (g_ensure_newline) { Well this code is senseless: 'hc -0 CMD' acts like 'hc CMD' and then appends the null-byte to its output. If you don't have an application where you need this, I'd suggest: - make -0 affect only the --idle/--wait mode - state it clear in the man page - adjust code accordingly If you want me to do that (in your name) while applying your patch, just ping me via irc/mail. Otherwise just resubmit the new patch. Afterwards I'll merge the --last-arg-patch (it looks fine). Cheers, Thorsten
Attachment:
pgpS1aGwB2P21.pgp
Description: PGP signature