From 9ec76e557390cfa660e88739882f84eee87e073f Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Thu, 23 Dec 2004 19:55:57 +0000
Subject: [PATCH] remove command line and rcfile option for --noutf8, as UTF-8
 support is now autodetected, and add #ifdefs around two variables that are
 unused when NANO_WIDE isn't defined

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2194 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog    |  8 +++-----
 src/nano.c   | 13 ++-----------
 src/rcfile.c |  3 ---
 src/winio.c  |  4 ++++
 4 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7da7f079..0c079388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,11 +29,9 @@ CVS code -
 	  by DLR)
 	- Change references to "open files" to "open file buffers", for
 	  consistency. (DLR)
-	- Add option to disable UTF-8 sequence interpretation:
-	  -O/--noutf8 on the command line, Meta-O as a toggle, and
-	  "noutf8" in the rcfile.  This is so people using single-byte
-	  encodings such as KOI8-R can type properly again. (DLR, found
-	  by Arthur Ivanov)
+	- Add flag to disable UTF-8 sequence interpretation, so that
+	  people using single-byte encodings such as KOI8-R can type
+	  properly again. (DLR, found by Arthur Ivanov)
 	- Massively overhaul the input and output routines to support
 	  buffered input and output, the first steps toward
 	  wide/multibyte character input and output, and
diff --git a/src/nano.c b/src/nano.c
index 817774ea..7f9b4215 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -929,9 +929,6 @@ void usage(void)
 #ifndef NANO_SMALL
     print1opt("-N", "--noconvert", N_("Don't convert files from DOS/Mac format"));
 #endif
-#ifdef NANO_WIDE
-    print1opt("-O", "--noutf8", N_("Don't convert files from UTF-8 format"));
-#endif
 #ifndef DISABLE_JUSTIFY
     print1opt(_("-Q [str]"), _("--quotestr=[str]"), N_("Quoting string, default \"> \""));
 #endif
@@ -3732,9 +3729,6 @@ int main(int argc, char **argv)
 #endif
 	{"ignorercfiles", 0, 0, 'I'},
 #endif
-#ifdef NANO_WIDE
-	{"noutf8", 0, 0, 'O'},
-#endif
 #ifndef DISABLE_JUSTIFY
 	{"quotestr", 1, 0, 'Q'},
 #endif
@@ -3812,9 +3806,9 @@ int main(int argc, char **argv)
 
     while ((optchr =
 #ifdef HAVE_GETOPT_LONG
-	getopt_long(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL)
+	getopt_long(argc, argv, "h?ABE:FHINQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL)
 #else
-	getopt(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz")
+	getopt(argc, argv, "h?ABE:FHINQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz")
 #endif
 		) != -1) {
 
@@ -3858,9 +3852,6 @@ int main(int argc, char **argv)
 		SET(NO_CONVERT);
 		break;
 #endif
-	    case 'O':
-		SET(NO_UTF8);
-		break;
 #ifndef DISABLE_JUSTIFY
 	    case 'Q':
 		quotestr = mallocstrcpy(quotestr, optarg);
diff --git a/src/rcfile.c b/src/rcfile.c
index a02805e8..8f1780cb 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -68,9 +68,6 @@ const static rcoption rcopts[] = {
 #endif
     {"nofollow", NOFOLLOW_SYMLINKS},
     {"nohelp", NO_HELP},
-#ifdef NANO_WIDE
-    {"noutf8", NO_UTF8},
-#endif
 #ifndef DISABLE_WRAPPING
     {"nowrap", NO_WRAP},
 #endif
diff --git a/src/winio.c b/src/winio.c
index ee013fdc..fb990b90 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1739,7 +1739,9 @@ size_t display_string_len(const char *buf, size_t start_col, size_t
 	int wide_buf_len;
 	    /* How many bytes wide is this character? */
 	size_t old_col = start_col;
+#ifdef NANO_WIDE
 	bool bad_char;
+#endif
 
 	wide_buf_len = parse_char(buf, &wide_buf, &start_col
 #ifdef NANO_WIDE
@@ -1884,7 +1886,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
 
     while (index < alloc_len && buf[start_index] != '\0') {
 	int wide_buf, wide_buf_len;
+#ifdef NANO_WIDE
 	bool bad_char;
+#endif
 
 	wide_buf_len = parse_char(buf + start_index, &wide_buf, NULL
 #ifdef NANO_WIDE
-- 
GitLab