<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 17 Jun 2009, at 05:19, Ethan Galstad wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Holger Weiss wrote:<br><blockquote type="cite">* Gerhard Lausser <<a href="mailto:Gerhard.Lausser@consol.de">Gerhard.Lausser@consol.de</a>> [2009-05-02 13:49]:<br></blockquote><blockquote type="cite"><blockquote type="cite">I attached a patch for base/utils.c(mmap_fgets_multiline) (v3.10) which cuts<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">off leading white space from continuation lines.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Of course, this breaks configurations which do stuff like<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">   </span>command_line $USER1$/check_foo one\<br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space:pre">    </span>                               two<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">and expect to get this parsed with white space between "one" and "two".<br></blockquote><blockquote type="cite">However, this incompatibility is probably negligible, and I guess most<br></blockquote><blockquote type="cite">users would prefer if leading white space was stripped from continuation<br></blockquote><blockquote type="cite">lines.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">So, I'd appreciate if the patch was committed.  I've attached a version<br></blockquote><blockquote type="cite">of the diff which updates cgi/cgiutils.c:mmap_fgets_multiline(), too,<br></blockquote><blockquote type="cite">and which simplifies the code a bit.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Holger<br></blockquote><blockquote type="cite"><br></blockquote><br>Thanks - patch is in CVS.</div></blockquote><div><br></div></div>While testing C code is pretty hard, testing configuration parsing is very easy. See <a href="http://wiki.nagios.org/index.php/Developer_Guidelines#Configuration_file_tests">http://wiki.nagios.org/index.php/Developer_Guidelines#Configuration_file_tests</a> for instructions. <div><br></div><div>I've committed a test case for the config generation based on Gerhard and Holger's examples. </div><div><br></div><div>So please consider this a little plea to add tests for patches when doing changes around configuration files :)</div><div><br></div><div>Ton</div><div><br></div></body></html>