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
1e2833e0
Commit
1e2833e0
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: elide two unneeded variables
parent
067b0a33
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
+13
-20
src/chars.c
with
13 additions
and
20 deletions
+13
-20
src/chars.c
View file @
1e2833e0
...
...
@@ -667,7 +667,6 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const
{
#ifdef ENABLE_UTF8
if
(
use_utf8
)
{
bool
begin_line
=
FALSE
;
size_t
rev_start_len
,
needle_len
;
assert
(
haystack
!=
NULL
&&
needle
!=
NULL
&&
rev_start
!=
NULL
);
...
...
@@ -682,22 +681,19 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const
rev_start_len
=
mbstrlen
(
rev_start
);
while
(
!
begin_line
)
{
while
(
TRUE
)
{
if
(
rev_start_len
>=
needle_len
&&
mbstrncasecmp
(
rev_start
,
needle
,
needle_len
)
==
0
&&
mblen
(
rev_start
,
MB_CUR_MAX
)
>
0
)
return
(
char
*
)
rev_start
;
/* If we've reached the head of the haystack, we found nothing. */
if
(
rev_start
==
haystack
)
begin_line
=
TRUE
;
else
{
rev_start
=
haystack
+
move_mbleft
(
haystack
,
rev_start
-
haystack
);
rev_start_len
++
;
}
}
return
NULL
;
return
NULL
;
rev_start
=
haystack
+
move_mbleft
(
haystack
,
rev_start
-
haystack
);
rev_start_len
++
;
}
}
else
#endif
return
revstrcasestr
(
haystack
,
needle
,
rev_start
);
...
...
@@ -837,22 +833,19 @@ char *mbrevstrpbrk(const char *s, const char *accept, const char
#ifdef ENABLE_UTF8
if
(
use_utf8
)
{
bool
begin_line
=
FALSE
;
while
(
!
begin_line
)
{
const
char
*
q
=
(
*
rev_start
==
'\0'
)
?
NULL
:
mbstrchr
(
accept
,
rev_start
);
while
(
TRUE
)
{
const
char
*
q
=
(
*
rev_start
==
'\0'
)
?
NULL
:
mbstrchr
(
accept
,
rev_start
);
if
(
q
!=
NULL
)
return
(
char
*
)
rev_start
;
/* If we've reached the head of the string, we found nothing. */
if
(
rev_start
==
s
)
begin_line
=
TRUE
;
else
rev_start
=
s
+
move_mbleft
(
s
,
rev_start
-
s
);
}
return
NULL
;
return
NULL
;
rev_start
=
s
+
move_mbleft
(
s
,
rev_start
-
s
);
}
}
else
#endif
return
revstrpbrk
(
s
,
accept
,
rev_start
);
...
...
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