resolv.conf option parsing: Fix word separation
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 11:06:09 +0000 (11:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Oct 2014 12:03:33 +0000 (12:03 +0000)
commite45372c163ef6a942f7856acf87173c8a79c3d85
tree10614a3716e213871f4b2f7212a4b88ea7f2de65
parent29bad808efa66ac3cd1169d1643bb6479abc1995
resolv.conf option parsing: Fix word separation

`nextword' does not nul-terminate the words it returns.  So the
strcmps in ccf_options are wrong.  Fix this as follows:

 * Abolish most uses of l in favour of a pointer variable endword.
 * Have OPTION_IS and OPTION_STARTS update word, and endword, so
   that it is convenient to use them for option values, etc.
 * Save the whole option in new variables opt and optend for
   reporting and to assist the `adns_af:' loop.
 * Use OPTION_IS, OPTION_STARTS and memchr, rather than strcmp,
   ad-hoc memcmp, and strcspn.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/setup.c