From: David Lawrence Ramsey Date: Sun, 31 Jul 2005 20:15:01 +0000 (+0000) Subject: fix cursor position display breakage X-Git-Tag: v1.3.9~92 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=15d6857b2739b53f1fd58e486a9048095f271fc2;p=nano.git fix cursor position display breakage git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2954 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index 58b027df..554697f8 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3823,6 +3823,7 @@ void display_main_list(void) * display the current cursor position next time. */ void do_cursorpos(bool constant) { + char c; size_t i = 0, cur_xpt = xplustabs() + 1; size_t cur_lenpt = strlenpt(openfile->current->data) + 1; int linepct, colpct, charpct; @@ -3831,7 +3832,10 @@ void do_cursorpos(bool constant) if (openfile->current->prev != NULL) i += get_totsize(openfile->fileage, openfile->current->prev); - i += mbstrnlen(openfile->current->data, openfile->current_x); + c = openfile->current->data[openfile->current_x]; + openfile->current->data[openfile->current_x] = '\0'; + i += mbstrlen(openfile->current->data); + openfile->current->data[openfile->current_x] = c; /* Check whether totsize is correct. If it isn't, there is a bug * somewhere. */