diff -u nano-22/nano.c nano-23/nano.c --- nano-22/nano.c Thu Jul 11 15:48:03 2002 +++ nano-23/nano.c Thu Jul 11 16:13:00 2002 @@ -2268,7 +2268,8 @@ } /* Perhaps the character after space_loc is a space. But because * of justify_format, there can be only two adjacent. */ - if (*(line - cur_loc + space_loc + 1) == ' ') + if (*(line - cur_loc + space_loc + 1) == ' ' || + *(line - cur_loc + space_loc + 1) == '\0') space_loc++; return space_loc; } @@ -2464,12 +2465,12 @@ break_pos = break_line(current->data + indent_len, fill - strnlenpt(current->data, indent_len), 1); - if (break_pos == -1) + if (break_pos == -1 || break_pos + indent_len == line_len) /* We can't break the line, or don't need to, so just go * on to the next. */ goto continue_loc; break_pos += indent_len; - assert(break_pos <= line_len); + assert(break_pos < line_len); /* If we haven't backed up the paragraph, do it now. */ if (first_mod_line == NULL) first_mod_line = backup_lines(current, par_len, quote_len); diff -u nano-22/winio.c nano-23/winio.c --- nano-22/winio.c Thu Jul 11 15:48:03 2002 +++ nano-23/winio.c Thu Jul 11 15:51:07 2002 @@ -397,6 +397,7 @@ nodelay(edit, FALSE); break; } + break; default: for (t = s; t != NULL; t = t->next) {