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

src/text.c

index b151403a2d7cdf4fa28e51bf60ba57e2d65af992..264c8657c742ef0fe0e3549db7caa6faf3fb754c 100644 (file)
@@ -599,6 +599,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool newline)
     if (blank_loc == -1) {
        /* No blank was found that was short enough. */
        bool found_blank = FALSE;
+       ssize_t found_blank_loc;
 
        while (*line != '\0') {
            line_len = parse_mbchar(line, NULL, NULL);
@@ -606,8 +607,9 @@ ssize_t break_line(const char *line, ssize_t goal, bool newline)
            if (is_blank_mbchar(line) || (newline && *line == '\n')) {
                if (!found_blank)
                    found_blank = TRUE;
+               found_blank_loc = cur_loc;
            } else if (found_blank)
-               return move_mbleft(line, cur_loc);
+               return found_blank_loc;
 
            line += line_len;
            cur_loc += line_len;