Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sertonix
apk-tools
Commits
7f8a1ca1
Commit
7f8a1ca1
authored
1 month ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
list, search: fix origin existence checks
Origin is an atom and is always non-null, check the length instead.
parent
00522cd6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app_list.c
+2
-3
2 additions, 3 deletions
src/app_list.c
src/app_search.c
+1
-1
1 addition, 1 deletion
src/app_search.c
with
3 additions
and
4 deletions
src/app_list.c
+
2
−
3
View file @
7f8a1ca1
...
...
@@ -35,8 +35,7 @@ static int origin_matches(const struct list_ctx *ctx, const struct apk_package *
{
char
**
pmatch
;
if
(
pkg
->
origin
==
NULL
)
return
0
;
if
(
pkg
->
origin
->
len
==
0
)
return
0
;
foreach_array_item
(
pmatch
,
ctx
->
filters
)
{
if
(
apk_blob_compare
(
APK_BLOB_STR
(
*
pmatch
),
*
pkg
->
origin
)
==
0
)
...
...
@@ -77,7 +76,7 @@ static void print_package(const struct apk_database *db, const struct apk_packag
printf
(
PKG_VER_FMT
" "
BLOB_FMT
" "
,
PKG_VER_PRINTF
(
pkg
),
BLOB_PRINTF
(
*
pkg
->
arch
));
if
(
pkg
->
origin
!=
NULL
)
if
(
pkg
->
origin
->
len
)
printf
(
"{"
BLOB_FMT
"}"
,
BLOB_PRINTF
(
*
pkg
->
origin
));
else
printf
(
"{%s}"
,
pkg
->
name
->
name
);
...
...
This diff is collapsed.
Click to expand it.
src/app_search.c
+
1
−
1
View file @
7f8a1ca1
...
...
@@ -41,7 +41,7 @@ static void print_package_name(struct search_ctx *ctx, struct apk_package *pkg)
static
void
print_origin_name
(
struct
search_ctx
*
ctx
,
struct
apk_package
*
pkg
)
{
if
(
pkg
->
origin
!=
NULL
)
if
(
pkg
->
origin
->
len
)
printf
(
BLOB_FMT
,
BLOB_PRINTF
(
*
pkg
->
origin
));
else
printf
(
"%s"
,
pkg
->
name
->
name
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment