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
f46544f6
Commit
f46544f6
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: chuck two useless asserts, and elide a call to strncasecmp()
parent
9462ba82
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
+3
-10
src/rcfile.c
with
3 additions
and
10 deletions
+3
-10
src/rcfile.c
View file @
f46544f6
...
...
@@ -613,8 +613,6 @@ void parse_includes(char *ptr)
* and set bright to TRUE if that color is bright. */
short
color_to_short
(
const
char
*
colorname
,
bool
*
bright
)
{
assert
(
colorname
!=
NULL
&&
bright
!=
NULL
);
if
(
strncasecmp
(
colorname
,
"bright"
,
6
)
==
0
)
{
*
bright
=
TRUE
;
colorname
+=
6
;
...
...
@@ -654,8 +652,6 @@ void parse_colors(char *ptr, int rex_flags)
bool
bright
=
FALSE
;
char
*
item
;
assert
(
ptr
!=
NULL
);
if
(
!
opensyntax
)
{
rcfile_error
(
N_
(
"A '%s' command requires a preceding 'syntax' command"
),
...
...
@@ -729,9 +725,6 @@ void parse_colors(char *ptr, int rex_flags)
newcolor
->
next
=
NULL
;
#ifdef DEBUG
fprintf
(
stderr
,
"Adding an entry for fg %hd, bg %hd
\n
"
,
fg
,
bg
);
#endif
if
(
lastcolor
==
NULL
)
live_syntax
->
color
=
newcolor
;
else
...
...
@@ -785,12 +778,12 @@ bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright)
char
*
comma
=
strchr
(
combostr
,
','
);
if
(
comma
!=
NULL
)
{
*
comma
=
'\0'
;
if
(
strncasecmp
(
comma
+
1
,
"bright"
,
6
)
==
0
)
{
*
bg
=
color_to_short
(
comma
+
1
,
bright
)
;
if
(
*
bright
)
{
rcfile_error
(
N_
(
"A background color cannot be bright"
));
return
FALSE
;
}
*
bg
=
color_to_short
(
comma
+
1
,
bright
)
;
*
comma
=
'\0'
;
}
else
*
bg
=
-
1
;
...
...
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