commit 85529b37c67f2ade875fafa7c6485f7a8b0bf4a5
parent 973a96be62cd91a2c2ad5bb7ff1eb818cecda9b7
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 22 Jun 2004 15:38:47 +0000
make the former flag same_line_wrap use TRUE and FALSE, add missing part
of DB's do_wrap() tweaks (the initialization of new_line_wrap to 0), and
wrap a few overly long comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1813 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -110,6 +110,8 @@ CVS code -
brackets used to control justification, via the rcfile
entries "punct" and "brackets". (DLR)
- Translation updates (see po/ChangeLog for details).
+ - Make the former flag same_line_wrap use TRUE and FALSE
+ instead of 1 and 0. (DLR)
- files.c:
add_open_file()
- Rearrange the NANO_SMALL #ifdef so that the code to set the
diff --git a/src/nano.c b/src/nano.c
@@ -61,15 +61,17 @@
static int fill = 0; /* Fill - where to wrap lines, basically */
#endif
#ifndef DISABLE_WRAPPING
-static int same_line_wrap = 0; /* Whether wrapped text should be
- prepended to the next line */
+static int same_line_wrap = FALSE; /* Whether wrapped text should
+ be prepended to the next
+ line */
#endif
static struct termios oldterm; /* The user's original term settings */
static struct sigaction act; /* For all our fun signal handlers */
#ifndef NANO_SMALL
-static sigjmp_buf jmpbuf; /* Used to return to mainloop after SIGWINCH */
+static sigjmp_buf jmpbuf; /* Used to return to mainloop after
+ SIGWINCH */
#endif
/* What we do when we're all set to exit. */
@@ -1253,7 +1255,7 @@ int do_mark(void)
#ifndef DISABLE_WRAPPING
void wrap_reset(void)
{
- same_line_wrap = 0;
+ same_line_wrap = FALSE;
}
#endif
@@ -1371,6 +1373,7 @@ int do_wrap(filestruct *inptr)
/* Now we allocate the new line and copy into it. */
newline = charalloc(new_line_len + 1); /* +1 for \0 */
+ new_line_len = 0;
*newline = '\0';
#ifndef NANO_SMALL
@@ -1423,7 +1426,7 @@ int do_wrap(filestruct *inptr)
* some other sundry things. */
/* later wraps of this line will be prepended to the next line. */
- same_line_wrap = 1;
+ same_line_wrap = TRUE;
/* Each line knows its line number. We recalculate these if we
* inserted a new line. */