From: Chris Allegretta Date: Sat, 12 Jul 2008 02:03:35 +0000 (+0000) Subject: * Fix for crashing in help menu when using certain locales X-Git-Tag: v2.0.8~4 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b5b8e15fbd555b65df75dcfb05b0fa7a13c78026;p=nano.git * Fix for crashing in help menu when using certain locales from Mitsuya Shibata (Savannah bug 23751) git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano@4273 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 9a773908..1c20a611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ CVS code - Jojo - nano.c: - Fix for segfault on resize by Andreas Amann +- text.c: + * Fix for crashing in help menu when using certain locales + from Mitsuya Shibata (Savannah bug + 23751) GNU nano 2.0.7 - 2007.12.20 - General: diff --git a/src/text.c b/src/text.c index ac6f473e..74f55889 100644 --- a/src/text.c +++ b/src/text.c @@ -800,6 +800,15 @@ ssize_t break_line(const char *line, ssize_t goal /* In fact, the whole line displays shorter than goal. */ 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) { /* No blank was found that was short enough. */ bool found_blank = FALSE;