Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
2ff398c6
Commit
2ff398c6
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle some stuff, and avoid a memory leak
parent
4b24ce1c
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rcfile.c
+11
-12
src/rcfile.c
with
11 additions
and
12 deletions
+11
-12
src/rcfile.c
View file @
2ff398c6
...
...
@@ -774,22 +774,21 @@ bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright)
return
TRUE
;
}
/* Parse interface color option
s
. */
/* Parse
the argument of an
interface color option. */
colortype
*
parse_interface_color
(
char
*
combostr
)
{
short
fg
,
bg
;
bool
bright
=
FALSE
;
colortype
*
newcolor
;
if
(
!
parse_color_names
(
combostr
,
&
fg
,
&
bg
,
&
bright
))
return
NULL
;
colortype
*
trio
=
nmalloc
(
sizeof
(
colortype
));
newcolor
=
(
colortype
*
)
nmalloc
(
sizeof
(
colortype
));
newcolor
->
fg
=
fg
;
newcolor
->
bg
=
bg
;
newcolor
->
bright
=
bright
;
trio
->
bright
=
FALSE
;
return
newcolor
;
if
(
parse_color_names
(
combostr
,
&
trio
->
fg
,
&
trio
->
bg
,
&
trio
->
bright
))
{
free
(
combostr
);
return
trio
;
}
else
{
free
(
combostr
);
free
(
trio
);
return
NULL
;
}
}
/* Read regex strings enclosed in double quotes from the line pointed at
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help