nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a5869ba4505908ebedbc7d0ca33e1577253ab6cf
parent 7bc324f276f7f76395066f5338301107409ac47b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  4 Apr 2019 13:52:27 +0200

tweaks: rename another variable, to be more fitting

Diffstat:
Msrc/text.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -1668,7 +1668,7 @@ size_t indent_length(const char *line) void squeeze(linestruct *line, size_t skip) { char *from, *to, *newdata; - size_t shift = 0; + size_t shrunk = 0; from = line->data + skip; newdata = charalloc(strlen(line->data) + 1); @@ -1691,7 +1691,7 @@ void squeeze(linestruct *line, size_t skip) charlen = parse_mbchar(from, NULL, NULL); from += charlen; - shift += 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 @@ -1737,7 +1737,7 @@ void squeeze(linestruct *line, size_t skip) charlen = parse_mbchar(from, NULL, NULL); from += charlen; - shift += charlen; + shrunk += charlen; } /* Leave unchanged anything that is neither blank nor punctuation. */ } else { @@ -1757,10 +1757,10 @@ void squeeze(linestruct *line, size_t skip) /* If there are spaces at the end of the line, remove them. */ while (to > newdata + skip && *(to - 1) == ' ') { to--; - shift++; + shrunk++; } - if (shift > 0) { + if (shrunk > 0) { null_at(&newdata, to - newdata); free(line->data); line->data = newdata;