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
f5155786
Commit
f5155786
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: adjust whitespace and comments after the preceding change
parent
a9abc3d9
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
+26
-26
src/chars.c
with
26 additions
and
26 deletions
+26
-26
src/chars.c
View file @
f5155786
...
...
@@ -376,34 +376,34 @@ size_t move_mbleft(const char *buf, size_t pos)
{
#ifdef ENABLE_UTF8
if
(
use_utf8
)
{
size_t
before
,
char_len
=
0
;
/* There is no library function to move backward one multibyte
* character. So we just start groping for one at the farthest
* possible point. */
if
(
pos
<
4
)
before
=
0
;
else
{
const
char
*
ptr
=
buf
+
pos
;
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
1
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
2
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
3
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
4
;
else
before
=
pos
-
1
;
}
size_t
before
,
char_len
=
0
;
while
(
before
<
pos
)
{
char_len
=
parse_mbchar
(
buf
+
before
,
NULL
,
NULL
);
before
+=
char_len
;
}
if
(
pos
<
4
)
before
=
0
;
else
{
const
char
*
ptr
=
buf
+
pos
;
/* Probe for a valid starter byte in the preceding four bytes. */
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
1
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
2
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
3
;
else
if
((
signed
char
)
*
(
--
ptr
)
>
-
65
)
before
=
pos
-
4
;
else
before
=
pos
-
1
;
}
/* Move forward again until we reach the original character,
* so we know the length of its preceding the character. */
while
(
before
<
pos
)
{
char_len
=
parse_mbchar
(
buf
+
before
,
NULL
,
NULL
);
before
+=
char_len
;
}
return
before
-
char_len
;
return
before
-
char_len
;
}
else
#endif
return
(
pos
==
0
?
0
:
pos
-
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