tweaks: adjust whitespace and comments after the preceding change
parent
a9abc3d95f
commit
f5155786e1
48
src/chars.c
48
src/chars.c
|
@ -376,34 +376,34 @@ size_t move_mbleft(const char *buf, size_t pos)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if (use_utf8) {
|
if (use_utf8) {
|
||||||
size_t before, char_len = 0;
|
size_t before, char_len = 0;
|
||||||
|
|
||||||
/* There is no library function to move backward one multibyte
|
if (pos < 4)
|
||||||
* character. So we just start groping for one at the farthest
|
before = 0;
|
||||||
* possible point. */
|
else {
|
||||||
if (pos < 4)
|
const char *ptr = buf + pos;
|
||||||
before = 0;
|
|
||||||
else {
|
|
||||||
const char *ptr = buf + pos;
|
|
||||||
|
|
||||||
if ((signed char)*(--ptr) > -65)
|
/* Probe for a valid starter byte in the preceding four bytes. */
|
||||||
before = pos - 1;
|
if ((signed char)*(--ptr) > -65)
|
||||||
else if ((signed char)*(--ptr) > -65)
|
before = pos - 1;
|
||||||
before = pos - 2;
|
else if ((signed char)*(--ptr) > -65)
|
||||||
else if ((signed char)*(--ptr) > -65)
|
before = pos - 2;
|
||||||
before = pos - 3;
|
else if ((signed char)*(--ptr) > -65)
|
||||||
else if ((signed char)*(--ptr) > -65)
|
before = pos - 3;
|
||||||
before = pos - 4;
|
else if ((signed char)*(--ptr) > -65)
|
||||||
else
|
before = pos - 4;
|
||||||
before = pos - 1;
|
else
|
||||||
}
|
before = pos - 1;
|
||||||
|
}
|
||||||
|
|
||||||
while (before < pos) {
|
/* Move forward again until we reach the original character,
|
||||||
char_len = parse_mbchar(buf + before, NULL, NULL);
|
* so we know the length of its preceding the character. */
|
||||||
before += char_len;
|
while (before < pos) {
|
||||||
}
|
char_len = parse_mbchar(buf + before, NULL, NULL);
|
||||||
|
before += char_len;
|
||||||
|
}
|
||||||
|
|
||||||
return before - char_len;
|
return before - char_len;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
return (pos == 0 ? 0 : pos - 1);
|
return (pos == 0 ? 0 : pos - 1);
|
||||||
|
|
Loading…
Reference in New Issue