tweaks: rename a variable, to be more distinct and more apt

master
Benno Schulenberg 2019-04-04 13:39:11 +02:00
parent 0c0afb0039
commit 8d40b568fa
1 changed files with 22 additions and 22 deletions

View File

@ -1676,78 +1676,78 @@ void squeeze(linestruct *line, size_t skip)
new_end = newdata + skip; new_end = newdata + skip;
while (*end != '\0') { while (*end != '\0') {
int end_len; int charlen;
/* If this character is blank, change it to a space, /* If this character is blank, change it to a space,
* and pass over all blanks after it. */ * and pass over all blanks after it. */
if (is_blank_mbchar(end)) { if (is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
*new_end = ' '; *new_end = ' ';
new_end++; new_end++;
end += end_len; end += charlen;
while (*end != '\0' && is_blank_mbchar(end)) { while (*end != '\0' && is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
end += end_len; end += charlen;
shift += end_len; shift += charlen;
} }
/* If this character is punctuation optionally followed by a bracket /* If this character is punctuation optionally followed by a bracket
* and then followed by blanks, change no more than two of the blanks * and then followed by blanks, change no more than two of the blanks
* to spaces if necessary, and pass over all blanks after them. */ * to spaces if necessary, and pass over all blanks after them. */
} else if (mbstrchr(punct, end) != NULL) { } else if (mbstrchr(punct, end) != NULL) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
while (end_len > 0) { while (charlen > 0) {
*new_end = *end; *new_end = *end;
new_end++; new_end++;
end++; end++;
end_len--; charlen--;
} }
if (*end != '\0' && mbstrchr(brackets, end) != NULL) { if (*end != '\0' && mbstrchr(brackets, end) != NULL) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
while (end_len > 0) { while (charlen > 0) {
*new_end = *end; *new_end = *end;
new_end++; new_end++;
end++; end++;
end_len--; charlen--;
} }
} }
if (*end != '\0' && is_blank_mbchar(end)) { if (*end != '\0' && is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
*new_end = ' '; *new_end = ' ';
new_end++; new_end++;
end += end_len; end += charlen;
} }
if (*end != '\0' && is_blank_mbchar(end)) { if (*end != '\0' && is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
*new_end = ' '; *new_end = ' ';
new_end++; new_end++;
end += end_len; end += charlen;
} }
while (*end != '\0' && is_blank_mbchar(end)) { while (*end != '\0' && is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
end += end_len; end += charlen;
shift += end_len; shift += charlen;
} }
/* Leave unchanged anything that is neither blank nor punctuation. */ /* Leave unchanged anything that is neither blank nor punctuation. */
} else { } else {
end_len = parse_mbchar(end, NULL, NULL); charlen = parse_mbchar(end, NULL, NULL);
while (end_len > 0) { while (charlen > 0) {
*new_end = *end; *new_end = *end;
new_end++; new_end++;
end++; end++;
end_len--; charlen--;
} }
} }
} }