aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine.c')
-rw-r--r--src/engine.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/engine.c b/src/engine.c
index 69f1c150..252d8805 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -449,9 +449,16 @@ _gpgme_set_engine_info (gpgme_engine_info_t info, gpgme_protocol_t proto,
new_home_dir = NULL;
}
- new_version = engine_get_version (proto, new_file_name);
+ if (info && info->version
+ && ((!info->file_name && !new_file_name)
+ || (info->file_name && new_file_name
+ && !strcmp (info->file_name, new_file_name))))
+ new_version = strdup (info->version);
+ else
+ new_version = engine_get_version (proto, new_file_name);
if (!new_version)
{
+ /* Note that we also get here on a ENOMEM in strdup. */
new_version = strdup ("1.0.0"); /* Fake one for dummy entries. */
if (!new_version)
{