Blame SOURCES/0364-improve-error-message-for-nonexist.-path.patch

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