Commit bdc1b9b5 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

really fix the previous break_line() problem

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3023 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 3 additions and 1 deletion
+3 -1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment