Re: xidle: improve program parsing

2018-11-04 Thread Klemens Nanni
The (obvious) fact that XrmParseCommand(3) modifies argv and and does *not* stop on invalid options only struck me this morning. So `xidle echo -timeout 1 foo' will print just "foo" every second on inactivity - this is bad.

Re: xidle: improve program parsing

2018-11-03 Thread Klemens Nanni
On Sun, Nov 04, 2018 at 03:52:06AM +0100, Klemens Nanni wrote: > - *area = strtol((char *)value.addr, &p, 10); > + *area = strtol((char *)value.addr, &p, 9); Oops, fat fingered. New diff without it. This was of course tested with various progams as well as the default sett

xidle: improve program parsing

2018-11-03 Thread Klemens Nanni
Lift the current argument limit (see BUGS section) and simplify the parsing logic by turning `xidle -program "/bin/prog args"' into `xidle prog args' where normal argv is used instead of an strsep(3) routine. Search PATH with execvp(3), drop unused status parameter from wait(2) while here. Merge