File: 06_add_system_dir.diff

package info (click to toggle)
libiodbc2 3.52.16-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,944 kB
  • sloc: ansic: 49,090; sh: 5,021; objc: 3,623; makefile: 543
file content (29 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Debian QA Group <packages@qa.debian.org>
Date: Mon, 17 Jul 2023 16:09:27 +0200
Subject: _add_system_dir

Add a system dir to be able to load drivers from a system dir without having a full
path to the drivers, as it is done nowadays on debian systems
---
 iodbc/connect.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/iodbc/connect.c b/iodbc/connect.c
index 632827f..ef07d36 100644
--- a/iodbc/connect.c
+++ b/iodbc/connect.c
@@ -1173,6 +1173,14 @@ _iodbcdm_driverload (
 
   genv = (GENV_t *) pdbc->genv;
 
+#ifdef SYSTEM_DIR
+  char path_with_multiarch[1024];
+  if (!(path[0] == '/' || path[0] == '.')) {
+      snprintf(path_with_multiarch,sizeof (path_with_multiarch), "%s/%s", SYSTEM_DIR, path);
+      path = path_with_multiarch;
+  }
+#endif 
+
   /* This will either load the driver dll or increase its reference count */
   hdll = _iodbcdm_dllopen ((char *) path);