]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: test-smtp-payload - Do not assume that a non-regular files is a directory.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 22 Jan 2019 22:21:46 +0000 (23:21 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 22 Jan 2019 22:24:07 +0000 (23:24 +0100)
The unit test failed if something else (like a socket) was found.

src/lib-smtp/test-smtp-payload.c

index e29d6f9e0b9baba3ecc28c508ad618df14dbf0b9..fa016cf64cb9755ab52bca29459d93a0b54d49c8 100644 (file)
@@ -94,7 +94,7 @@ static void test_files_read_dir(const char *path)
                                file += 2; /* skip "./" */
                                file = p_strdup(files_pool, file);
                                array_push_back(&files, &file);
-                       } else {
+                       } else if (S_ISDIR(st.st_mode)) {
                                test_files_read_dir(file);
                        }
                }