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-d3aeb78583b8master
parent
fc693210d5
commit
9ec76e5573
|
@ -29,11 +29,9 @@ CVS code -
|
||||||
by DLR)
|
by DLR)
|
||||||
- Change references to "open files" to "open file buffers", for
|
- Change references to "open files" to "open file buffers", for
|
||||||
consistency. (DLR)
|
consistency. (DLR)
|
||||||
- Add option to disable UTF-8 sequence interpretation:
|
- Add flag to disable UTF-8 sequence interpretation, so that
|
||||||
-O/--noutf8 on the command line, Meta-O as a toggle, and
|
people using single-byte encodings such as KOI8-R can type
|
||||||
"noutf8" in the rcfile. This is so people using single-byte
|
properly again. (DLR, found by Arthur Ivanov)
|
||||||
encodings such as KOI8-R can type properly again. (DLR, found
|
|
||||||
by Arthur Ivanov)
|
|
||||||
- Massively overhaul the input and output routines to support
|
- Massively overhaul the input and output routines to support
|
||||||
buffered input and output, the first steps toward
|
buffered input and output, the first steps toward
|
||||||
wide/multibyte character input and output, and
|
wide/multibyte character input and output, and
|
||||||
|
|
13
src/nano.c
13
src/nano.c
|
@ -929,9 +929,6 @@ void usage(void)
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
print1opt("-N", "--noconvert", N_("Don't convert files from DOS/Mac format"));
|
print1opt("-N", "--noconvert", N_("Don't convert files from DOS/Mac format"));
|
||||||
#endif
|
#endif
|
||||||
#ifdef NANO_WIDE
|
|
||||||
print1opt("-O", "--noutf8", N_("Don't convert files from UTF-8 format"));
|
|
||||||
#endif
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
print1opt(_("-Q [str]"), _("--quotestr=[str]"), N_("Quoting string, default \"> \""));
|
print1opt(_("-Q [str]"), _("--quotestr=[str]"), N_("Quoting string, default \"> \""));
|
||||||
#endif
|
#endif
|
||||||
|
@ -3732,9 +3729,6 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
{"ignorercfiles", 0, 0, 'I'},
|
{"ignorercfiles", 0, 0, 'I'},
|
||||||
#endif
|
#endif
|
||||||
#ifdef NANO_WIDE
|
|
||||||
{"noutf8", 0, 0, 'O'},
|
|
||||||
#endif
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
{"quotestr", 1, 0, 'Q'},
|
{"quotestr", 1, 0, 'Q'},
|
||||||
#endif
|
#endif
|
||||||
|
@ -3812,9 +3806,9 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
while ((optchr =
|
while ((optchr =
|
||||||
#ifdef HAVE_GETOPT_LONG
|
#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
|
#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
|
#endif
|
||||||
) != -1) {
|
) != -1) {
|
||||||
|
|
||||||
|
@ -3858,9 +3852,6 @@ int main(int argc, char **argv)
|
||||||
SET(NO_CONVERT);
|
SET(NO_CONVERT);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 'O':
|
|
||||||
SET(NO_UTF8);
|
|
||||||
break;
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifndef DISABLE_JUSTIFY
|
||||||
case 'Q':
|
case 'Q':
|
||||||
quotestr = mallocstrcpy(quotestr, optarg);
|
quotestr = mallocstrcpy(quotestr, optarg);
|
||||||
|
|
|
@ -68,9 +68,6 @@ const static rcoption rcopts[] = {
|
||||||
#endif
|
#endif
|
||||||
{"nofollow", NOFOLLOW_SYMLINKS},
|
{"nofollow", NOFOLLOW_SYMLINKS},
|
||||||
{"nohelp", NO_HELP},
|
{"nohelp", NO_HELP},
|
||||||
#ifdef NANO_WIDE
|
|
||||||
{"noutf8", NO_UTF8},
|
|
||||||
#endif
|
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
{"nowrap", NO_WRAP},
|
{"nowrap", NO_WRAP},
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1739,7 +1739,9 @@ size_t display_string_len(const char *buf, size_t start_col, size_t
|
||||||
int wide_buf_len;
|
int wide_buf_len;
|
||||||
/* How many bytes wide is this character? */
|
/* How many bytes wide is this character? */
|
||||||
size_t old_col = start_col;
|
size_t old_col = start_col;
|
||||||
|
#ifdef NANO_WIDE
|
||||||
bool bad_char;
|
bool bad_char;
|
||||||
|
#endif
|
||||||
|
|
||||||
wide_buf_len = parse_char(buf, &wide_buf, &start_col
|
wide_buf_len = parse_char(buf, &wide_buf, &start_col
|
||||||
#ifdef NANO_WIDE
|
#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') {
|
while (index < alloc_len && buf[start_index] != '\0') {
|
||||||
int wide_buf, wide_buf_len;
|
int wide_buf, wide_buf_len;
|
||||||
|
#ifdef NANO_WIDE
|
||||||
bool bad_char;
|
bool bad_char;
|
||||||
|
#endif
|
||||||
|
|
||||||
wide_buf_len = parse_char(buf + start_index, &wide_buf, NULL
|
wide_buf_len = parse_char(buf + start_index, &wide_buf, NULL
|
||||||
#ifdef NANO_WIDE
|
#ifdef NANO_WIDE
|
||||||
|
|
Loading…
Reference in New Issue