summaryrefslogtreecommitdiff
path: root/libpkgconf
diff options
context:
space:
mode:
authorPierre Pronchery <khorben@FreeBSD.org>2026-06-25 22:30:05 +0000
committerPierre Pronchery <khorben@FreeBSD.org>2026-06-29 05:21:48 +0000
commitb0fc1b7a2fe8fcb18ee407227591bf25a86ffbaf (patch)
tree0cc32f86bf808bcf9d79da95db969cd76f0feadb /libpkgconf
parenteaa637963bcfde283b411c14968b7903b02d6aa1 (diff)
Diffstat (limited to 'libpkgconf')
-rw-r--r--libpkgconf/libpkgconf.h4
-rw-r--r--libpkgconf/pkg.c2
-rw-r--r--libpkgconf/version.c36
3 files changed, 14 insertions, 28 deletions
diff --git a/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf.h
index 205e88e6e8b6..22b6c97a94f8 100644
--- a/libpkgconf/libpkgconf.h
+++ b/libpkgconf/libpkgconf.h
@@ -71,8 +71,8 @@ typedef struct pkgconf_license_ pkgconf_license_t;
#define PKGCONF_FOREACH_LIST_ENTRY_REVERSE(tail, value) \
for ((value) = (tail); (value) != NULL; (value) = (value)->prev)
-#define LIBPKGCONF_VERSION 20991
-#define LIBPKGCONF_VERSION_STR "2.9.91"
+#define LIBPKGCONF_VERSION 20992
+#define LIBPKGCONF_VERSION_STR "2.9.92"
struct pkgconf_queue_ {
pkgconf_node_t iter;
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
index 79a4e1d6065f..16e38e6e3783 100644
--- a/libpkgconf/pkg.c
+++ b/libpkgconf/pkg.c
@@ -1678,7 +1678,7 @@ pkgconf_pkg_traverse_main(pkgconf_client_t *client,
if (root->identifier == 0)
root->identifier = ++client->identifier;
- PKGCONF_TRACE(client, "%s: level %d, serial %"PRIu64, root->id, maxdepth, client->serial);
+ PKGCONF_TRACE(client, "%s: level %d, serial %llu", root->id, maxdepth, (unsigned long long) client->serial);
if ((root->flags & PKGCONF_PKG_PROPF_VIRTUAL) != PKGCONF_PKG_PROPF_VIRTUAL || (client->flags & PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL) != PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL)
{
diff --git a/libpkgconf/version.c b/libpkgconf/version.c
index 7b597bd721b2..9a958fe3d1f6 100644
--- a/libpkgconf/version.c
+++ b/libpkgconf/version.c
@@ -23,8 +23,7 @@ typedef enum {
PKGCONF_VERSION_TOKEN_END = 0,
PKGCONF_VERSION_TOKEN_TILDE,
PKGCONF_VERSION_TOKEN_NUMERIC,
- PKGCONF_VERSION_TOKEN_ALPHA,
- PKGCONF_VERSION_TOKEN_OTHER
+ PKGCONF_VERSION_TOKEN_ALPHA
} pkgconf_version_token_kind_t;
typedef struct {
@@ -85,17 +84,14 @@ pkgconf_version_next_token(pkgconf_version_iter_t *it)
return tok;
}
- if (isalpha((unsigned char)*s))
- {
- tok.kind = PKGCONF_VERSION_TOKEN_ALPHA;
- while (*tok.end && isalpha((unsigned char)*tok.end))
- tok.end++;
- it->cur = tok.end;
- return tok;
- }
-
- tok.kind = PKGCONF_VERSION_TOKEN_OTHER;
- tok.end = s + 1;
+ /*
+ * Having skipped separators and ruled out end-of-string, tilde and
+ * digits, the only remaining possibility is alpha: isalnum(c) is by
+ * definition isalpha(c) || isdigit(c).
+ */
+ tok.kind = PKGCONF_VERSION_TOKEN_ALPHA;
+ while (*tok.end && isalpha((unsigned char)*tok.end))
+ tok.end++;
it->cur = tok.end;
return tok;
@@ -190,20 +186,10 @@ pkgconf_version_compare_token(const pkgconf_version_token_t *a, const pkgconf_ve
}
/* left-side is alpha, any right-side non-alpha wins */
- if (a->kind == PKGCONF_VERSION_TOKEN_ALPHA)
- {
- if (b->kind != PKGCONF_VERSION_TOKEN_ALPHA)
- return -1;
-
- return pkgconf_version_compare_alpha(a, b);
- }
-
- if (a->kind < b->kind)
+ if (b->kind != PKGCONF_VERSION_TOKEN_ALPHA)
return -1;
- if (a->kind > b->kind)
- return 1;
- return 0;
+ return pkgconf_version_compare_alpha(a, b);
}
/*