Commit 09b81248 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Savannah bug 23751: Segfault when viewing help using Japanese locale

Fix break_line crashing when using certain locales from Mitsuya Shibata



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 12 additions and 0 deletions
+12 -0
2008-07-11 Mitsuya Shibata <mty.shibata@gmail.com>
* text.c: Fix crashing in help menu when using certain locales
2008-07-09 Chris Allegretta <chrisa@asty.org> 2008-07-09 Chris Allegretta <chrisa@asty.org>
* nano.c/nano.h/global.c/text.c: New generalized undo code, currently * nano.c/nano.h/global.c/text.c: New generalized undo code, currently
just works for adding and deleting text and splitting and unsplitting lines. just works for adding and deleting text and splitting and unsplitting lines.
......
...@@ -1127,6 +1127,15 @@ ssize_t break_line(const char *line, ssize_t goal ...@@ -1127,6 +1127,15 @@ ssize_t break_line(const char *line, ssize_t goal
/* In fact, the whole line displays shorter than goal. */ /* In fact, the whole line displays shorter than goal. */
return cur_loc; return cur_loc;
#ifndef DISABLE_HELP
if (newln && blank_loc <= 0) {
/* If blank was not found or was found only first character,
* force line break. */
cur_loc -= line_len;
return cur_loc;
}
#endif
if (blank_loc == -1) { if (blank_loc == -1) {
/* No blank was found that was short enough. */ /* No blank was found that was short enough. */
bool found_blank = FALSE; bool found_blank = FALSE;
......
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