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
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
#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
#endif
{"ignorercfiles", 0, 0, 'I'},
#endif
-#ifdef NANO_WIDE
- {"noutf8", 0, 0, 'O'},
-#endif
#ifndef DISABLE_JUSTIFY
{"quotestr", 1, 0, 'Q'},
#endif
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) {
SET(NO_CONVERT);
break;
#endif
- case 'O':
- SET(NO_UTF8);
- break;
#ifndef DISABLE_JUSTIFY
case 'Q':
quotestr = mallocstrcpy(quotestr, optarg);
#endif
{"nofollow", NOFOLLOW_SYMLINKS},
{"nohelp", NO_HELP},
-#ifdef NANO_WIDE
- {"noutf8", NO_UTF8},
-#endif
#ifndef DISABLE_WRAPPING
{"nowrap", NO_WRAP},
#endif
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
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