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
b305911c
Commit
b305911c
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
chars: straighten out the flow of a loop, so it is easier to follow
parent
d60f9513
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/chars.c
+5
-2
src/chars.c
with
5 additions
and
2 deletions
+5
-2
src/chars.c
View file @
b305911c
...
...
@@ -512,8 +512,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
assert
(
s1
!=
NULL
&&
s2
!=
NULL
);
for
(;
*
s1
!=
'\0'
&&
*
s2
!=
'\0'
&&
n
>
0
;
s1
+=
move_mbright
(
s1
,
0
),
s2
+=
move_mbright
(
s2
,
0
),
n
--
)
{
while
(
*
s1
!=
'\0'
&&
*
s2
!=
'\0'
&&
n
>
0
)
{
bool
bad1
=
FALSE
,
bad2
=
FALSE
;
if
(
mbtowc
(
&
wc1
,
s1
,
MB_CUR_MAX
)
<
0
)
{
...
...
@@ -530,6 +529,10 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
if
(
bad1
!=
bad2
||
towlower
(
wc1
)
!=
towlower
(
wc2
))
break
;
s1
+=
move_mbright
(
s1
,
0
);
s2
+=
move_mbright
(
s2
,
0
);
n
--
;
}
return
(
n
>
0
)
?
towlower
(
wc1
)
-
towlower
(
wc2
)
:
0
;
...
...
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