Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
c459891a
Commit
c459891a
authored
Aug 03, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: Correctly compare the version number.
parent
38f0f82f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
src/misc/update.c
src/misc/update.c
+22
-4
No files found.
src/misc/update.c
View file @
c459891a
...
...
@@ -1403,14 +1403,32 @@ void update_CheckReal( update_check_thread_t *p_uct )
* \param p_update structure
* \return true if we have to upgrade to the given version to be up to date
*/
static
bool
is_strictly_greater
(
int
*
a
,
int
*
b
,
int
n
)
{
if
(
n
<=
0
)
return
false
;
if
(
a
[
0
]
>
b
[
0
]
)
return
true
;
if
(
a
[
0
]
==
b
[
0
]
)
return
is_strictly_greater
(
a
+
1
,
b
+
1
,
n
-
1
);
/* a[0] < b[0] */
return
false
;
}
bool
update_NeedUpgrade
(
update_t
*
p_update
)
{
assert
(
p_update
);
return
p_update
->
release
.
i_major
<
*
PACKAGE_VERSION_MAJOR
-
'0'
||
p_update
->
release
.
i_minor
<
*
PACKAGE_VERSION_MINOR
-
'0'
||
p_update
->
release
.
i_revision
<
*
PACKAGE_VERSION_REVISION
-
'0'
||
p_update
->
release
.
extra
<
*
PACKAGE_VERSION_EXTRA
;
int
current_version
[]
=
{
*
PACKAGE_VERSION_MAJOR
-
'0'
,
*
PACKAGE_VERSION_MINOR
-
'0'
,
*
PACKAGE_VERSION_REVISION
-
'0'
,
*
PACKAGE_VERSION_EXTRA
};
int
latest_version
[]
=
{
p_update
->
release
.
i_major
,
p_update
->
release
.
i_minor
,
p_update
->
release
.
i_revision
,
p_update
->
release
.
extra
};
return
is_strictly_greater
(
latest_version
,
current_version
,
4
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment