summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-11-02 16:24:58 +0100
committerWerner Koch <wk@gnupg.org>2016-11-02 17:58:11 +0100
commit488b183811fc25c1ae49b4730491accf1adf518e (patch)
tree1c86b55b957697b398f8320cb86c55055eed9dc1 /sm
parentgpgscm: Fix inclusion of readline header. (diff)
downloadgnupg2-488b183811fc25c1ae49b4730491accf1adf518e.tar.xz
gnupg2-488b183811fc25c1ae49b4730491accf1adf518e.zip
common: Improve compare_string_versions.
* common/stringhelp.c: Include limits.h. (compare_version_strings): Change semantics to behave like strcmp. Include the patch lebel in the comparison. Allow checking a single version string. * common/t-stringhelp.c (test_compare_version_strings): Adjust test vectors and a few new vectors. * g10/call-agent.c (warn_version_mismatch): Adjust to new sematics. * g10/call-dirmngr.c (warn_version_mismatch): Ditto. * sm/call-agent.c (warn_version_mismatch): Ditto. * sm/call-dirmngr.c (warn_version_mismatch): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'sm')
-rw-r--r--sm/call-agent.c2
-rw-r--r--sm/call-dirmngr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c
index c0a2081fe..c9a210fa5 100644
--- a/sm/call-agent.c
+++ b/sm/call-agent.c
@@ -97,7 +97,7 @@ warn_version_mismatch (ctrl_t ctrl, assuan_context_t ctx,
if (err)
log_error (_("error getting version from '%s': %s\n"),
servername, gpg_strerror (err));
- else if (!compare_version_strings (serverversion, myversion))
+ else if (compare_version_strings (serverversion, myversion) < 0)
{
char *warn;
diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c
index 03c9a6833..6d7053c54 100644
--- a/sm/call-dirmngr.c
+++ b/sm/call-dirmngr.c
@@ -163,7 +163,7 @@ warn_version_mismatch (ctrl_t ctrl, assuan_context_t ctx,
if (err)
log_error (_("error getting version from '%s': %s\n"),
servername, gpg_strerror (err));
- else if (!compare_version_strings (serverversion, myversion))
+ else if (compare_version_strings (serverversion, myversion) < 0)
{
char *warn;