File: 06_add_system_dir.diff

package info (click to toggle)
libiodbc2 3.52.9-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 7,508 kB
  • sloc: ansic: 58,625; sh: 11,061; makefile: 616; objc: 603
file content (22 lines) | stat: -rw-r--r-- 816 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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

Index: libiodbc2/iodbc/connect.c
===================================================================
--- libiodbc2.orig/iodbc/connect.c	2014-05-09 13:08:22.282851046 +0200
+++ libiodbc2/iodbc/connect.c	2014-05-09 13:08:22.282851046 +0200
@@ -1088,6 +1088,14 @@
 
   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);