tweaks: drop unneeded braces and adjust indentation after previous change
parent
929770191e
commit
df7fe1280d
16
src/chars.c
16
src/chars.c
|
@ -259,9 +259,9 @@ size_t mbstrlen(const char *pointer)
|
||||||
|
|
||||||
while (*pointer != '\0') {
|
while (*pointer != '\0') {
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if ((unsigned char)*pointer > 0xC1) {
|
if ((unsigned char)*pointer > 0xC1)
|
||||||
pointer += char_length(pointer);
|
pointer += char_length(pointer);
|
||||||
} else
|
else
|
||||||
#endif
|
#endif
|
||||||
pointer++;
|
pointer++;
|
||||||
|
|
||||||
|
@ -279,9 +279,9 @@ int collect_char(const char *string, char *thechar)
|
||||||
|
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
/* If this is a UTF-8 starter byte, get the number of bytes of the character. */
|
/* If this is a UTF-8 starter byte, get the number of bytes of the character. */
|
||||||
if ((unsigned char)*string > 0xC1) {
|
if ((unsigned char)*string > 0xC1)
|
||||||
charlen = char_length(string);
|
charlen = char_length(string);
|
||||||
} else
|
else
|
||||||
#endif
|
#endif
|
||||||
charlen = 1;
|
charlen = 1;
|
||||||
|
|
||||||
|
@ -297,10 +297,10 @@ int advance_over(const char *string, size_t *column)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if ((signed char)*string < 0) {
|
if ((signed char)*string < 0) {
|
||||||
if (is_cntrl_char(string))
|
if (is_cntrl_char(string))
|
||||||
*column += 2;
|
*column += 2;
|
||||||
else
|
else
|
||||||
*column += mbwidth(string);
|
*column += mbwidth(string);
|
||||||
|
|
||||||
return char_length(string);
|
return char_length(string);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue