]> git.wh0rd.org Git - nano.git/commitdiff
*really* fix the previous break_line() problem
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 20 Sep 2005 17:47:27 +0000 (17:47 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 20 Sep 2005 17:47:27 +0000 (17:47 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3024 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/text.c

index 264c8657c742ef0fe0e3549db7caa6faf3fb754c..173e09358b1d2a3ed82f7f236cb1061a78370fbb 100644 (file)
@@ -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;