Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
53d16a5a
Commit
53d16a5a
authored
10 months ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
use stack instead of sastr with version_store
parent
df296900
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/utils/version.c
+7
-7
7 additions, 7 deletions
src/lib66/utils/version.c
with
7 additions
and
7 deletions
src/lib66/utils/version.c
+
7
−
7
View file @
53d16a5a
...
...
@@ -19,7 +19,6 @@
#include
<oblibs/stack.h>
#include
<skalibs/types.h>
#include
<skalibs/stralloc.h>
int
version_compare
(
char
const
*
a
,
char
const
*
b
,
uint8_t
ndot
)
{
...
...
@@ -50,7 +49,7 @@ int version_compare(char const *a, char const *b, uint8_t ndot)
return
0
;
}
int
version_store
(
st
ralloc
*
s
a
,
char
const
*
str
,
uint8_t
ndot
)
int
version_store
(
st
ack
*
s
tk
,
char
const
*
str
,
uint8_t
ndot
)
{
log_flow
()
;
...
...
@@ -60,7 +59,7 @@ int version_store(stralloc *sa, char const *str, uint8_t ndot)
size_t
slen
=
strlen
(
str
)
;
char
snum
[
slen
+
1
]
;
auto_strings
(
snum
,
str
)
;
s
a
->
len
=
0
;
s
tack_reset
(
stk
)
;
while
(
dot
<
ndot
+
1
)
{
size_t
len
=
strlen
(
snum
)
;
...
...
@@ -69,13 +68,14 @@ int version_store(stralloc *sa, char const *str, uint8_t ndot)
char
tmp
[
len
+
1
]
;
auto_strings
(
tmp
,
snum
+
r
+
1
)
;
if
(
!
uint0_scan
(
tmp
,
&
num
))
return
0
;
if
(
!
st
ralloc
_insert
s
(
s
a
,
0
,
tmp
))
return
-
1
;
if
(
!
st
ack
_insert
(
s
tk
,
0
,
tmp
))
return
-
1
;
if
(
dot
<
ndot
)
if
(
!
st
ralloc
_insert
s
(
s
a
,
0
,
"."
))
return
-
1
;
if
(
!
st
ack
_insert
(
s
tk
,
0
,
"."
))
return
-
1
;
dot
++
;
snum
[
r
]
=
0
;
}
if
(
!
stralloc_0
(
sa
))
return
-
1
;
sa
->
len
--
;
if
(
!
stack_close
(
stk
))
return
-
1
;
return
1
;
}
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