From 3c7839a75bdf8d033152d16fa9abad2c8bf7ae5c Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 7 Dec 2015 13:10:50 +0100 Subject: [PATCH 364/398] improve error message for nonexist. path ... which is currently somewhat misleading, because it mentions libmerged.so. Change-Id: I1ab21ce0fe2f94eba1831c2c977d900827f320f1 (cherry picked from commit 764ec21307009a84b2611fed5cb20069caa6d566) (cherry picked from commit 01825a8c1722161876fa8209e15e413c44774a5c) --- include/LibreOfficeKit/LibreOfficeKitInit.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h index cb3654808cf9..2d0b00299800 100644 --- a/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -154,6 +154,13 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib ) if (!install_path) return NULL; + struct stat dir_st; + if (stat(install_path, &dir_st) != 0) + { + fprintf(stderr, "installation path \"%s\" does not exist\n", install_path); + return NULL; + } + // allocate large enough buffer partial_length = strlen(install_path); imp_lib = (char *) malloc(partial_length + sizeof(TARGET_LIB) + sizeof(TARGET_MERGED_LIB) + 2); -- 2.12.0