[svn] dirmngr - r308 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Tue Sep 30 15:09:32 CEST 2008
Author: marcus
Date: 2008-09-30 15:09:32 +0200 (Tue, 30 Sep 2008)
New Revision: 308
Modified:
trunk/src/ChangeLog
trunk/src/get-path.c
Log:
2008-09-30 Marcus Brinkmann <marcus at g10code.com>
* get-path.c (dirmngr_cachedir): Make COMP a pointer to const to
silence gcc warning.
(get_dirmngr_ldap_path): Look for dirmngr_ldap in the installation
directory.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2008-08-06 11:46:39 UTC (rev 307)
+++ trunk/src/ChangeLog 2008-09-30 13:09:32 UTC (rev 308)
@@ -1,3 +1,10 @@
+2008-09-30 Marcus Brinkmann <marcus at g10code.com>
+
+ * get-path.c (dirmngr_cachedir): Make COMP a pointer to const to
+ silence gcc warning.
+ (get_dirmngr_ldap_path): Look for dirmngr_ldap in the installation
+ directory.
+
2008-08-06 Marcus Brinkmann <marcus at g10code.com>
* dirmngr.c (main): Mark the ldapserverlist-file option as
Modified: trunk/src/get-path.c
===================================================================
--- trunk/src/get-path.c 2008-08-06 11:46:39 UTC (rev 307)
+++ trunk/src/get-path.c 2008-09-30 13:09:32 UTC (rev 308)
@@ -236,7 +236,39 @@
return -1;
}
+
static char *
+find_program_in_inst_dir (const char *name)
+{
+ char *result = NULL;
+ char *tmp;
+
+ tmp = read_w32_registry_string ("HKEY_LOCAL_MACHINE",
+ "Software\\GNU\\GnuPG",
+ "Install Directory");
+ if (!tmp)
+ return NULL;
+
+ result = malloc (strlen (tmp) + 1 + strlen (name) + 1);
+ if (!result)
+ {
+ free (tmp);
+ return NULL;
+ }
+
+ strcpy (stpcpy (stpcpy (result, tmp), "\\"), name);
+ free (tmp);
+ if (access (result, F_OK))
+ {
+ free (result);
+ return NULL;
+ }
+
+ return result;
+}
+
+
+static char *
find_program_at_standard_place (const char *name)
{
char path[MAX_PATH];
@@ -267,6 +299,8 @@
#ifdef HAVE_W32_SYSTEM
if (!pgmname)
+ pgmname = find_program_in_inst_dir ("dirmngr_ldap.exe");
+ if (!pgmname)
pgmname = find_program_at_standard_place ("GNU\\GnuPG\\dirmngr_ldap.exe");
#endif
if (!pgmname)
@@ -512,7 +546,7 @@
char path[MAX_PATH];
const char *s1[] = { "GNU", "cache", "dirmngr", NULL };
int s1_len;
- char **comp;
+ const char **comp;
s1_len = 0;
for (comp = s1; *comp; comp++)
More information about the Gnupg-commits
mailing list