commit ca37ee67d97444f7abe7a0fd8330cb17ca48bd8d
parent bdc1b9b56824fbc1f31a772cf7c08a7927e86340
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 20 Sep 2005 17:47:27 +0000
*really* fix the previous break_line() problem
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3024 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -575,10 +575,9 @@ ssize_t break_line(const char *line, ssize_t goal, bool newline)
assert(line != NULL);
while (*line != '\0' && goal >= 0) {
- int pos;
+ size_t pos = 0;
- line_len = parse_mbchar(line, NULL, NULL);
- pos = mbwidth(line);
+ line_len = parse_mbchar(line, NULL, &pos);
if (is_blank_mbchar(line) || (newline && *line == '\n')) {
blank_loc = cur_loc;