From: David Lawrence Ramsey Date: Wed, 5 Jan 2005 06:09:34 +0000 (+0000) Subject: put back two of the hacks of DB's that are actually needed (we need one X-Git-Tag: v1.3.6~170 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9dffac90e741be00e0311eaed162923e3aef551e;p=nano.git put back two of the hacks of DB's that are actually needed (we need one since we can't add half a two-column character to converted in display_string(), and we need the other to keep the "$" from spilling over to the next line if the line contains two-column characters in the right places) git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2232 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index 6fd93d3e..2d0b23aa 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2273,6 +2273,11 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool size_t index; /* Current position in converted. */ + /* If dollars is TRUE, make room for the "$" at the end of the + * line. */ + if (dollars && len > 0 && strlenpt(buf) > start_col + len) + len--; + if (len == 0) return mallocstrcpy(NULL, ""); @@ -2341,9 +2346,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool } #ifdef NANO_WIDE else if (wcwidth((wchar_t)wide_buf) > 1) { - index++; - if (dollars && column == start_col) - index++; + converted[index++] = ' '; start_col++; start_index += wide_buf_len;