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

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