#if HAVE_CONFIG_H
# include <config.h>
#endif
-# include <assert.h>
/* Specification. */
#include "path-concat.h"
in the result, removing any redundant separators.
In any case, if BASE_IN_RESULT is non-NULL, set
*BASE_IN_RESULT to point to the copy of ABASE in the returned
- concatenation.
+ concatenation. However, if ABASE begins with more than one slash,
+ set *BASE_IN_RESULT to point to the sole corresponding slash that
+ is copied into the result buffer.
Report an error if memory is exhausted. */
p = mempcpy (p, base, baselen);
*p = '\0';
- assert (!base_in_result
- || strcmp (*base_in_result, abase) == 0);
-
return p_concat;
}
{"/", "/", "/"},
{"a", "/", "a/"}, /* this might deserve a diagnostic */
{"/a", "/", "/a/"}, /* this might deserve a diagnostic */
+ {"a", "//b", "a/b"},
};
size_t i;
bool fail = false;