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
044864ae
Commit
044864ae
authored
9 months ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Always use closed string
parent
590821d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/include/66/parse.h
+1
-1
1 addition, 1 deletion
src/include/66/parse.h
src/lib66/parse/parse_bracket.c
+3
-3
3 additions, 3 deletions
src/lib66/parse/parse_bracket.c
src/lib66/parse/parse_value.c
+6
-4
6 additions, 4 deletions
src/lib66/parse/parse_value.c
with
10 additions
and
8 deletions
src/include/66/parse.h
+
1
−
1
View file @
044864ae
...
...
@@ -82,7 +82,7 @@ extern int parse_get_section(lexer_config *acfg, unsigned int *ncfg, char const
extern
int
parse_key
(
stack
*
key
,
lexer_config
*
cfg
,
key_description_t
const
*
list
)
;
extern
int
parse_value
(
stack
*
store
,
lexer_config
*
kcfg
,
const
int
sid
,
key_description_t
const
*
list
,
int
const
kid
)
;
extern
int
parse_list
(
stack
*
stk
)
;
extern
int
parse_bracket
(
stack
*
store
,
lexer_config
*
kcfg
,
const
int
sid
)
;
extern
int
parse_bracket
(
stack
*
store
,
const
char
*
line
,
const
int
sid
)
;
extern
int
parse_clean_runas
(
char
const
*
str
,
int
idsec
,
int
idkey
)
;
extern
int
parse_get_value_of_key
(
stack
*
store
,
char
const
*
str
,
const
int
sid
,
key_description_t
const
*
list
,
const
int
kid
)
;
extern
int
parse_mandatory
(
resolve_service_t
*
res
)
;
...
...
This diff is collapsed.
Click to expand it.
src/lib66/parse/parse_bracket.c
+
3
−
3
View file @
044864ae
...
...
@@ -62,7 +62,7 @@ static void key_isvalid(const char *line, size_t *o, uint8_t *bracket, int *vp,
return
;
}
int
parse_bracket
(
stack
*
store
,
lexer_config
*
kcfg
,
const
int
sid
)
int
parse_bracket
(
stack
*
store
,
const
char
*
str
,
const
int
sid
)
{
log_flow
()
;
...
...
@@ -72,8 +72,8 @@ int parse_bracket(stack *store, lexer_config *kcfg, const int sid)
lexer_config
cfg
=
LEXER_CONFIG_ZERO
;
cfg
.
str
=
kcfg
->
str
+
kcfg
->
cpos
;
cfg
.
slen
=
kcfg
->
slen
-
kcfg
->
cpos
;
cfg
.
str
=
str
;
cfg
.
slen
=
strlen
(
str
)
;
cfg
.
open
=
"("
;
cfg
.
olen
=
1
;
cfg
.
close
=
")
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
src/lib66/parse/parse_value.c
+
6
−
4
View file @
044864ae
...
...
@@ -25,8 +25,11 @@ int parse_value(stack *store, lexer_config *kcfg, const int sid, key_description
size_t
pos
=
0
;
lexer_config
vcfg
=
LEXER_CONFIG_ZERO
;
_alloc_stk_
(
stk
,
kcfg
->
slen
-
kcfg
->
cpos
)
;
log_trace
(
"parsing value of key: "
,
*
list
[
kid
].
name
)
;
memcpy
(
stk
.
s
,
kcfg
->
str
+
kcfg
->
cpos
,
strlen
(
kcfg
->
str
+
kcfg
->
cpos
))
;
stk
.
s
[
strlen
(
kcfg
->
str
+
kcfg
->
cpos
)]
=
0
;
switch
(
list
[
kid
].
expected
)
{
...
...
@@ -34,18 +37,17 @@ int parse_value(stack *store, lexer_config *kcfg, const int sid, key_description
vcfg
=
LEXER_CONFIG_QUOTE
;
lexer_reset
(
&
vcfg
)
;
vcfg
.
str
=
kcfg
->
str
+
kcfg
->
cpo
s
;
vcfg
.
str
=
stk
.
s
;
vcfg
.
slen
=
kcfg
->
slen
-
kcfg
->
cpos
;
if
(
!
lexer
(
store
,
&
vcfg
))
parse_error_return
(
LOG_EXIT_ZERO
,
6
,
sid
,
list
,
kid
)
;
kcfg
->
pos
+=
vcfg
.
pos
-
1
;
break
;
case
EXPECT_BRACKET
:
pos
=
0
;
if
(
!
parse_bracket
(
store
,
kcfg
,
sid
))
if
(
!
parse_bracket
(
store
,
stk
.
s
,
sid
))
parse_error_return
(
LOG_EXIT_ZERO
,
6
,
sid
,
list
,
kid
)
;
kcfg
->
pos
+=
pos
;
break
;
...
...
@@ -56,7 +58,7 @@ int parse_value(stack *store, lexer_config *kcfg, const int sid, key_description
vcfg
=
LEXER_CONFIG_INLINE
;
lexer_reset
(
&
vcfg
)
;
vcfg
.
str
=
kcfg
->
str
+
kcfg
->
cpo
s
;
vcfg
.
str
=
stk
.
s
;
vcfg
.
slen
=
kcfg
->
slen
-
kcfg
->
cpos
;
if
(
!
lexer
(
store
,
&
vcfg
))
parse_error_return
(
LOG_EXIT_ZERO
,
6
,
sid
,
list
,
kid
)
;
...
...
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