Commit e8aac698 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Thank you mr

parent 734f3c65
......@@ -7423,10 +7423,12 @@ typedef struct _parsed_version_st {
} parsed_version_t;
static int compare_parsed_versions(parsed_version_t current_version, parsed_version_t last_version) {
if (last_version.major < current_version.major) return -1;
if (last_version.minor < current_version.minor) return -1;
if (last_version.patch < current_version.patch) return -1;
return 1;
boolean same_major = (last_version.major == current_version.major);
boolean same_minor = (last_version.minor == current_version.minor);
if (last_version.major > current_version.major) return 1;
if (same_major && last_version.minor > current_version.minor) return 1;
if (same_minor && last_version.patch > current_version.patch) return 1;
return -1;
}
static void parse_version(const char *version, parsed_version_t *parsed_version) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment