On 3/23/2017 1:45 PM, Stefan Beller wrote:
On Thu, Mar 23, 2017 at 8:25 AM, Ramsay Jones
<ramsay@xxxxxxxxxxxxxxxxxxxx> wrote:
+ /*
+ * Either we have a parent directory and path with slash(es)
+ * or the directory is an immediate child of the root directory.
+ */
+ assert((parent != NULL) ^ (strchr(prefix->buf, '/') == 0));
Also this seems part of the actual shipped code, not testing code.
In that case we prefer
if (<condition>)
die("BUG: <description>");
This is because asserts may be omitted by the compiler,
when compiled with NDEBUG.
I mainly wrote that for myself while testing. Now that I'm
past that, I'm comfortable removing it completely or converting
it to an actual if-die.
Jeff