summaryrefslogtreecommitdiff
path: root/src/version.c
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:33 +0900
committerJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:33 +0900
commit262a6d564b513034547cfb9840eb6b6e1dc48a13 (patch)
tree27ff2895a1e1ef383cce8c8f368326e3289518a7 /src/version.c
parent26fb537f9cf011eaeaf975adcad5e8e9154d04fd (diff)
downloadgpgme-262a6d564b513034547cfb9840eb6b6e1dc48a13.tar.gz
gpgme-262a6d564b513034547cfb9840eb6b6e1dc48a13.tar.bz2
gpgme-262a6d564b513034547cfb9840eb6b6e1dc48a13.zip
Imported Upstream version 1.4.0upstream/1.4.0
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/version.c b/src/version.c
index 3aef404..18825f8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -1,19 +1,19 @@
/* version.c - Version check routines.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -69,7 +69,7 @@ do_subsystem_inits (void)
/* We need to make sure that the sockets are initialized. */
{
WSADATA wsadat;
-
+
WSAStartup (0x202, &wsadat);
}
#endif
@@ -83,6 +83,21 @@ do_subsystem_inits (void)
}
+/* Put vesion information into the binary. */
+static const char *
+cright_blurb (void)
+{
+ static const char blurb[] =
+ "\n\n"
+ "This is GPGME " PACKAGE_VERSION " - The GnuPG Made Easy library\n"
+ CRIGHTBLURB
+ "\n"
+ "(" BUILD_REVISION " " BUILD_TIMESTAMP ")\n"
+ "\n\n";
+ return blurb;
+}
+
+
/* Read the next number in the version string STR and return it in
*NUMBER. Return a pointer to the tail of STR after parsing, or
*NULL if the version string was invalid. */
@@ -159,7 +174,7 @@ _gpgme_compare_versions (const char *my_version,
if (my_major > rq_major
|| (my_major == rq_major && my_minor > rq_minor)
- || (my_major == rq_major && my_minor == rq_minor
+ || (my_major == rq_major && my_minor == rq_minor
&& my_micro > rq_micro)
|| (my_major == rq_major && my_minor == rq_minor
&& my_micro == rq_micro && strcmp (my_plvl, rq_plvl) >= 0))
@@ -191,7 +206,7 @@ gpgme_check_version (const char *req_version)
TRACE2 (DEBUG_INIT, "gpgme_check_version", 0,
"req_version=%s, VERSION=%s",
req_version? req_version:"(null)", VERSION);
-
+
result = _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL;
if (result != NULL)
_gpgme_selftest = 0;
@@ -208,6 +223,8 @@ gpgme_check_version_internal (const char *req_version,
{
const char *result;
+ if (req_version && req_version[0] == 1 && req_version[1] == 1)
+ return cright_blurb ();
result = gpgme_check_version (req_version);
if (result == NULL)
return result;
@@ -233,7 +250,7 @@ gpgme_check_version_internal (const char *req_version,
/* Extract the version string of a program from STRING. The version
number is expected to be in GNU style format:
-
+
foo 1.2.3
foo (bar system) 1.2.3
foo 1.2.3 cruft