nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e4cb3158fdad22170d68d9e6beaf6598e0749c09
parent 6439330d590acd0a5a11c84c6ace45f2e843ec02
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Mon, 25 Apr 2005 22:48:58 +0000

in do_output(), fix an off-by-one error that allowed wrapping when we
inserted a tab, for Pico compatibility


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2489 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 3+++
Msrc/nano.c | 5+++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -32,6 +32,9 @@ CVS code - - Replace a set_modified() with SET(MODIFIED) to avoid an unnecessary update, and remove an unneeded clearok(FALSE). (DLR) + do_output() + - Fix off-by-one error that allowed wrapping when we inserted a + tab, for Pico compatibility. (DLR) - utils.c: num_of_digits() - Use a size_t instead of an int, and rename to digits(). (DLR) diff --git a/src/nano.c b/src/nano.c @@ -3927,8 +3927,9 @@ void do_output(char *output, size_t output_len, bool allow_cntrls) do_right(FALSE); #ifndef DISABLE_WRAPPING - /* If we're wrapping text, we need to call edit_refresh(). */ - if (!ISSET(NO_WRAP) && output[i] != '\t') { + /* If we're wrapping text and we didn't insert a tab, we need to + * call edit_refresh(). */ + if (!ISSET(NO_WRAP) && output[i - 1] != '\t') { bool do_refresh_save = do_refresh; do_refresh = do_wrap(current);