Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
sergi
Tor
Commits
f29de4b8
Commit
f29de4b8
authored
5 years ago
by
teor
Browse files
Options
Downloads
Patches
Plain Diff
confmgt: Stop adding a space, when there is no option value
Fixes bug 32352; bugfix on 0.0.9pre6.
parent
5d85c247
Branches
bug_40061
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug32352
+6
-0
6 additions, 0 deletions
changes/bug32352
src/lib/confmgt/confmgt.c
+6
-3
6 additions, 3 deletions
src/lib/confmgt/confmgt.c
with
12 additions
and
3 deletions
changes/bug32352
0 → 100644
+
6
−
0
View file @
f29de4b8
o Minor bugfixes (config):
- When dumping the config, stop adding a trailing space after the option
name, when there is no option value. This issue only affects options
that accept an empty value or list. (Most options reject empty values,
or delete the entire line from the dumped options.)
Fixes bug 32352; bugfix on 0.0.9pre6.
This diff is collapsed.
Click to expand it.
src/lib/confmgt/confmgt.c
+
6
−
3
View file @
f29de4b8
...
...
@@ -1307,9 +1307,10 @@ config_dump(const config_mgr_t *mgr, const void *default_options,
*/
continue
;
}
smartlist_add_asprintf
(
elements
,
"%s%s %s
\n
"
,
int
value_exists
=
line
->
value
&&
*
(
line
->
value
);
smartlist_add_asprintf
(
elements
,
"%s%s%s%s
\n
"
,
comment_option
?
"# "
:
""
,
line
->
key
,
line
->
value
);
line
->
key
,
value_exists
?
" "
:
""
,
line
->
value
);
}
config_free_lines
(
assigned
);
}
SMARTLIST_FOREACH_END
(
mv
);
...
...
@@ -1317,7 +1318,9 @@ config_dump(const config_mgr_t *mgr, const void *default_options,
if
(
fmt
->
extra
)
{
line
=
*
(
config_line_t
**
)
STRUCT_VAR_P
(
options
,
fmt
->
extra
->
offset
);
for
(;
line
;
line
=
line
->
next
)
{
smartlist_add_asprintf
(
elements
,
"%s %s
\n
"
,
line
->
key
,
line
->
value
);
int
value_exists
=
line
->
value
&&
*
(
line
->
value
);
smartlist_add_asprintf
(
elements
,
"%s%s%s
\n
"
,
line
->
key
,
value_exists
?
" "
:
""
,
line
->
value
);
}
}
...
...
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