Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check version for pkgname correctly #15860

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions libr/util/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ R_API int r_lib_open_ptr(RLib *lib, const char *file, void *handler, RLibStruct
if (stru->pkgname) {
const char *dot = strchr (stru->version, '.');
int major = atoi (stru->version);
int minor = atoi (dot + 1);
if (major >= R2_VERSION_MAJOR && minor >= R2_VERSION_MINOR) {
int minor = dot ? atoi (dot + 1) : 0;
// The pkgname member was introduced in 4.2.0
if (major >= 4 || (major == 4 && minor >= 2)) {
printf ("r2pm -ci %s\n", stru->pkgname);
}
}
Expand Down