Compare commits

...

2 Commits

Author SHA1 Message Date
Colin Gillespie dd6a8e3fc7 cli: trim trailing whitespace from package arguments
ci/woodpecker/push/woodpecker Pipeline was successful Details
Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
2023-10-09 06:36:47 +00:00
Ariadne Conill 97d907ba93 cli: remove strncmp() from modversion comparison
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
2023-10-09 06:35:26 +00:00
1 changed files with 7 additions and 2 deletions

View File

@ -306,7 +306,7 @@ 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;
if (strncmp(pkg->why, queue_node->package, strlen(pkg->why)))
if (strcmp(pkg->why, queue_node->package))
continue;
if (pkg->version != NULL) {
@ -1341,7 +1341,8 @@ cleanup3:
while (1)
{
const char *package = argv[pkg_optind];
char *package = argv[pkg_optind];
char *end;
if (package == NULL)
break;
@ -1361,6 +1362,10 @@ cleanup3:
continue;
}
end = package + strlen(package) - 1;
while(end > package && isspace((unsigned char)end[0])) end--;
end[1] = '\0';
if (argv[pkg_optind + 1] == NULL || !PKGCONF_IS_OPERATOR_CHAR(*(argv[pkg_optind + 1])))
{
pkgconf_queue_push(&pkgq, package);