Fix option handling for the timing-output option to cf-agent
Merge pull request #1899 from jooooooon/fix-timing-option

Fix option handling for the timing-output option to cf-agent
Include type definitions when declaring functions that use them.

A header should not reference a type for which it doesn't provide a
declaration, ideally via the appropriate other header.  I wanted to
call cf_closesocket but pulling in the header that provides it gave me
compiler errors because of references to undefined types in functions
I wasn't interested in.
Merge pull request #1900 from ediosyncratic/header-fix

Include type definitions when declaring functions that use them.
Merge pull request #1898 from nickanderson/redmine/6516

Add: Acceptance test for rendering quotes in mustache
Fix for test of mustache's rendering of quotes.

The test expected variable expansion to be unescaped, but it's escaped
by default; it needs an & at the start of the variable name to
suppress escaping.  I've duly expanded the test to test both escaped
and unescaped variable expansion.
Merge pull request #1903 from ediosyncratic/mustache-fix

redmine6524: Fix for test of mustache's rendering of quotes.
Only filter init out of process matches when we *are* signaling.

FindPidMatches() filters pid 1 (init) out of its result list because
we don't want to be sending it stray signals - we should only do this
when a.signals is set, though !  We special-case HUP and allow it; but
then a check on pid < 4 will exclude it anyway, regardless; so make
that an else clause of the pid == 1 check, so avoid subverting the HUP
exception.  Finally, combine these and the "don't shoot yourself"
exception for cfengine_pid into a single block conditioned on
a.signals instead of testing it separately for each of these cases.
redmine4094: Infer start-time from elapsed when needed.

Some variants of ps report start-time as a date if before today (no
matter how recently today started) or even report a year for dates
before this year (even if new year's day started mere seconds ago).
These, naturally, give very imprecise information.  When that happens
but we have an elapsed time column (containing a value we can parse),
use this to infer a better start-time.  At the same time, improve
parsing of relevant time strings generally.  Based on a patch from
Tony Lill - many thanks.

Added an acceptance test.  Failed before the fix, passes with it :-)
Merge pull request #1849 from ediosyncratic/stime-fix

redmine4094: Infer start-time from elapsed when needed.
Updated expected output of returnszero.cf

Mark's changes to Log()ging appear to have left this out of sync with
reality.
Merge pull request #1904 from ediosyncratic/logging-fix

Updated expected output of returnszero.cf
Fix fence-post error in my re-write of SplitProcLine().

I was leaving ep pointing at the last character of the space-delimited
field, not at the character after it.  How did that even work on the
systems where it did ?
Clean-up and documentation in processes_select.c

Corrected a Log() message that thought it only related to elapsed
time; it could also relate to other times.  Use isspace() rather
than only comparison to ' ' in case there are tabs.

Made some variables more local, made some comments clearer, added some
comments.  Petty consistency in typography of isspace() calls.
Merge pull request #1905 from ediosyncratic/ps-parse-fix

Fix an off-by-one error in my recent rework of SplitProcLine()
Cope with ps's numeric (e.g. time) fields overflowing to the right.

This can happen, despite such fields normally being right-aligned,
when the field is too wide or some earlier field has overflowed, thus
pushing the affected field to the right.  This can push an internal
punctuator of the shunted field into the right-alignment position, so
adjust the test for "looks like a numeric field that may overspill
left" test as well as ajusting the "grow right" stanza to also happen
for numeric fields that have been shunted.

Prompted by overnight tests failing on a build machine which sees:
USER       PID  PPID  PGID %CPU %MEM  NI    SZ    VSZ   RSS NLWP STIME     ELAPSED     TIME COMMAND
jenkins  31941 31939 31939  1.1  0.2   0  9938  39752  4552    1 May20 92-21:17:55 1-02:07:14 sshd: jenkins@notty
(eliding a bunch of other lines), in which the TIME field's part
directly under the header, ":07:", starts and ends in colons, so was
not recognised as "numeric" (ends in digit); and needs to grow to the
right as well as left, despite being numeric (so trying to be
right-aligned).
Merge pull request #1907 from ediosyncratic/ps-overspill-fix

Cope with ps's numeric (e.g. time) fields overflowing to the right.
clarify that on() starts day and month on 0 (bad, but changing would break back-compat)
test for on(), primarily to test integer size on some unices
Change: Add alternate unescape form to mustache render quotes test

The mustache spec allows variables to be inside of `{{{`.
This extends the test to cover that style in addition to including the
characters to not escape.