Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/pkgconf: fix regression introduced by last minute patch
the last minute patch was intended to fix a bug in pkgconf which broke the expected behaviour of cabal (haskell) $ pkgconf --modversion atf-c atf-c++ 0.21 0.21 0.21 due to bad pattern matching, the fix was a bit too harsh and broke the version comparison $ pkgconf --modversion "gtk+-2.0 >= 2.0.0" Reported by: cmt
- Loading branch information
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
diff --git cli/main.c cli/main.c | ||
index 25ff5ca..d75bbb7 100644 | ||
index 25ff5ca..055b05a 100644 | ||
--- cli/main.c | ||
+++ cli/main.c | ||
@@ -306,7 +306,7 @@ apply_modversion(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int | ||
@@ -305,10 +305,13 @@ apply_modversion(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int | ||
{ | ||
pkgconf_dependency_t *dep = world_iter->data; | ||
pkgconf_pkg_t *pkg = dep->match; | ||
+ size_t len = strlen(pkg->id); | ||
|
||
- if (strncmp(pkg->id, queue_node->package, strlen(pkg->id))) | ||
+ if (strcmp(pkg->id, queue_node->package)) | ||
+ if (strncmp(pkg->id, queue_node->package, len)) | ||
continue; | ||
|
||
+ if (!isspace(queue_node->package[len]) && queue_node->package[len] != '\0') | ||
+ continue; | ||
if (pkg->version != NULL) { | ||
if (verbosity) | ||
printf("%s: ", pkg->id); |