From 8d911991a3ac7de7113da230bbb8ce6a3a609fd3 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 29 May 2004 17:05:52 +0000
Subject: [PATCH] add a few comment fixes and an explicit check in rcfile.c for
 rcopts[i].name's being "tabsize" (to avoid a spurious error under some
 circumstances about tabsize's being 0 when there's no tabsize entry in the
 rcfile)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1785 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog    |  3 +++
 src/nano.c   | 12 ++++++------
 src/rcfile.c |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9ab2643a..7e304ce1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -240,6 +240,9 @@ CVS code -
 - rcfile.c:
 	- Move "rebinddelete" up in the list of options so that the list
 	  is in alphabetical order. (DLR)
+	- Explicitly check for rcopts[i].name's being "tabsize" to avoid
+	  a spurious error under some circumstances about tabsize's
+	  being 0 when there's no tabsize entry in the rcfile. (DLR)
 - search.c:
   regexp_init()
 	- Overhaul for efficiency.  Also check if regcomp() failed, and
diff --git a/src/nano.c b/src/nano.c
index 99c0a2fe..3cec1a25 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1290,8 +1290,8 @@ int do_wrap(filestruct *inptr)
  * such that the last word before it ended at or before fill.  If there
  * is no such point, we settle for the first legal wrap point.
  *
- * A "legal wrap point" is a white-space character that is not followed by
- * white-space.
+ * A "legal wrap point" is a whitespace character that is not followed
+ * by whitespace.
  *
  * If there is no legal wrap point or we found the last character of the
  * line, we should return without wrapping.
@@ -1299,8 +1299,8 @@ int do_wrap(filestruct *inptr)
  * Note that the initial indentation does not count as a legal wrap
  * point if we are going to auto-indent!
  *
- * Note that the code below could be optimised, by not calling strnlenpt()
- * so often. */
+ * Note that the code below could be optimized, by not calling
+ * strnlenpt() so often. */
 
 #ifndef NANO_SMALL
     if (ISSET(AUTOINDENT))
@@ -1874,8 +1874,8 @@ int do_spell(void)
 #endif /* !DISABLE_SPELLER */
 
 #if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
-/* The "indentation" of a line is the white-space between the quote part
- * and the non-white-space of the line. */
+/* The "indentation" of a line is the whitespace between the quote part
+ * and the non-whitespace of the line. */
 size_t indent_length(const char *line)
 {
     size_t len = 0;
diff --git a/src/rcfile.c b/src/rcfile.c
index fa99dcee..a40b6fc1 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -637,7 +637,7 @@ void parse_rcfile(FILE *rcstream)
 				alt_speller = mallocstrcpy(NULL, option);
 			    else
 #endif
-			    {
+			    if (!strcasecmp(rcopts[i].name, "tabsize")) {
 				char *first_error;
 
 				/* Using strtol instead of atoi lets us
-- 
GitLab