commit c224ea3ce770ab5f0aba889b673d246d5efe39cd
parent 2a2fe7208a4d5fa67fffe821b2046f42f808554e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 4 Apr 2019 14:23:07 +0200
tweaks: reshuffle two lines, and reword a comment
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -1669,15 +1669,14 @@ void squeeze(linestruct *line, size_t skip)
{
char *from, *to, *newdata;
size_t shrunk = 0;
+ int charlen;
- from = line->data + skip;
newdata = charalloc(strlen(line->data) + 1);
strncpy(newdata, line->data, skip);
+ from = line->data + skip;
to = newdata + skip;
while (*from != '\0') {
- int charlen;
-
/* If this character is blank, change it to a space,
* and pass over all blanks after it. */
if (is_blank_mbchar(from)) {
@@ -1689,9 +1688,9 @@ void squeeze(linestruct *line, size_t skip)
from += charlen;
shrunk += charlen;
}
- /* If this character is punctuation optionally followed by a bracket
- * and then followed by blanks, change no more than two of the blanks
- * to spaces if necessary, and pass over all blanks after them. */
+ /* If this character is punctuation, then copy it plus a possible
+ * bracket, and change at most two of subsequent blanks to spaces,
+ * and pass over all blanks after these. */
} else if (mbstrchr(punct, from) != NULL) {
charlen = parse_mbchar(from, NULL, NULL);