Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
f467c2fc
Commit
f467c2fc
authored
Feb 10, 2016
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak error handling in parse_config_line.
parent
709df665
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
configuration.c
configuration.c
+12
-8
No files found.
configuration.c
View file @
f467c2fc
...
@@ -821,7 +821,7 @@ parse_config_line(int c, gnc_t gnc, void *closure)
...
@@ -821,7 +821,7 @@ parse_config_line(int c, gnc_t gnc, void *closure)
char
*
token
;
char
*
token
;
c
=
skip_whitespace
(
c
,
gnc
,
closure
);
c
=
skip_whitespace
(
c
,
gnc
,
closure
);
if
(
c
==
'\n'
||
c
==
'#'
)
if
(
c
<
0
||
c
==
'\n'
||
c
==
'#'
)
return
skip_to_eol
(
c
,
gnc
,
closure
);
return
skip_to_eol
(
c
,
gnc
,
closure
);
c
=
getword
(
c
,
&
token
,
gnc
,
closure
);
c
=
getword
(
c
,
&
token
,
gnc
,
closure
);
...
@@ -832,36 +832,36 @@ parse_config_line(int c, gnc_t gnc, void *closure)
...
@@ -832,36 +832,36 @@ parse_config_line(int c, gnc_t gnc, void *closure)
struct
filter
*
filter
;
struct
filter
*
filter
;
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
add_filter
(
filter
,
&
input_filters
);
add_filter
(
filter
,
&
input_filters
);
}
else
if
(
strcmp
(
token
,
"out"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"out"
)
==
0
)
{
struct
filter
*
filter
;
struct
filter
*
filter
;
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
add_filter
(
filter
,
&
output_filters
);
add_filter
(
filter
,
&
output_filters
);
}
else
if
(
strcmp
(
token
,
"redistribute"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"redistribute"
)
==
0
)
{
struct
filter
*
filter
;
struct
filter
*
filter
;
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
add_filter
(
filter
,
&
redistribute_filters
);
add_filter
(
filter
,
&
redistribute_filters
);
}
else
if
(
strcmp
(
token
,
"install"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"install"
)
==
0
)
{
struct
filter
*
filter
;
struct
filter
*
filter
;
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
c
=
parse_filter
(
c
,
gnc
,
closure
,
&
filter
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
}
else
if
(
strcmp
(
token
,
"interface"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"interface"
)
==
0
)
{
struct
interface_conf
*
if_conf
;
struct
interface_conf
*
if_conf
;
c
=
parse_ifconf
(
c
,
gnc
,
closure
,
&
if_conf
);
c
=
parse_ifconf
(
c
,
gnc
,
closure
,
&
if_conf
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
add_ifconf
(
if_conf
,
&
interface_confs
);
add_ifconf
(
if_conf
,
&
interface_confs
);
}
else
if
(
strcmp
(
token
,
"default"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"default"
)
==
0
)
{
struct
interface_conf
*
if_conf
;
struct
interface_conf
*
if_conf
;
c
=
parse_anonymous_ifconf
(
c
,
gnc
,
closure
,
NULL
,
&
if_conf
);
c
=
parse_anonymous_ifconf
(
c
,
gnc
,
closure
,
NULL
,
&
if_conf
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
if
(
default_interface_conf
==
NULL
)
if
(
default_interface_conf
==
NULL
)
default_interface_conf
=
if_conf
;
default_interface_conf
=
if_conf
;
else
{
else
{
...
@@ -872,10 +872,14 @@ parse_config_line(int c, gnc_t gnc, void *closure)
...
@@ -872,10 +872,14 @@ parse_config_line(int c, gnc_t gnc, void *closure)
}
else
{
}
else
{
c
=
parse_option
(
c
,
gnc
,
closure
,
token
);
c
=
parse_option
(
c
,
gnc
,
closure
,
token
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
return
-
1
;
goto
fail
;
}
}
free
(
token
);
free
(
token
);
return
c
;
return
c
;
fail:
free
(
token
);
return
-
2
;
}
}
struct
file_state
{
struct
file_state
{
...
...
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