Skip to content

Commit

Permalink
Merge pull request #1284 from techee/updatechecker
Browse files Browse the repository at this point in the history
updatechecker: Fix logic comparing version numbers
  • Loading branch information
techee authored Oct 17, 2023
2 parents 54e9319 + d5f345f commit e794ccc
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions updatechecker/src/updatechecker.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,22 @@ version_compare(const gchar *current_version)
parse_version_string(current_version, &geany_current.major,
&geany_current.minor, &geany_current.mini, &geany_current.extra);

if ((geany_running.major < geany_current.major) ||
(geany_running.minor < geany_current.minor) ||
(geany_running.minor < geany_current.minor))
{
if (geany_running.major < geany_current.major)
return TRUE;
}
else
{
if (geany_running.major > geany_current.major)
return FALSE;
}

if (geany_running.minor < geany_current.minor)
return TRUE;
if (geany_running.minor > geany_current.minor)
return FALSE;

if (geany_running.mini < geany_current.mini)
return TRUE;
if (geany_running.mini > geany_current.mini)
return FALSE;

return FALSE;
}


Expand Down

0 comments on commit e794ccc

Please sign in to comment.