From: Timo Sirainen Date: Sat, 10 Jun 2017 07:35:54 +0000 (+0300) Subject: lib: Fix test-path-util unit test with some cwd path lengths X-Git-Tag: 2.3.0.rc1~1461 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dead275d577c87b8f8ba476a7709db758dfffb9b;p=thirdparty%2Fdovecot%2Fcore.git lib: Fix test-path-util unit test with some cwd path lengths The component-component directory might not have been created at all, in which case the following symlink creations would fail since they were already created to the same directory in a previous test. --- diff --git a/src/lib/test-path-util.c b/src/lib/test-path-util.c index 0d1c761c82..9c05617397 100644 --- a/src/lib/test-path-util.c +++ b/src/lib/test-path-util.c @@ -133,7 +133,7 @@ static void test_link_alloc(void) string_t *basedir = t_str_new(256); str_append(basedir, cwd); str_append(basedir, "/"TEMP_DIRNAME); - size_t len = nearest_power(I_MAX(127, str_len(basedir))) - + size_t len = nearest_power(I_MAX(127, str_len(basedir) + strlen(COMPONENT_COMPONENT) + 1)) - strlen(COMPONENT_COMPONENT); while(str_len(basedir) < len) {