diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2015-07-25 15:41:05 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2015-07-25 15:57:00 -0400 |
commit | 5836a818eccb180d75c92ce4c861abb6fe8dec23 (patch) | |
tree | 624044ca5df5a6c192e47933a735ab4fe9aaea71 /readline/nls.c | |
parent | b8cc7b2e9afab37eb9a7cff0d3ae4ebbcf7d494f (diff) | |
download | fsf-binutils-gdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.zip fsf-binutils-gdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.tar.gz fsf-binutils-gdb-5836a818eccb180d75c92ce4c861abb6fe8dec23.tar.bz2 |
Revert "Sync readline/ to version 7.0 alpha"
This reverts commit b558ff043d41ba8d17a82f5f9ae5f9dade66160e.
This reverts commit 4a11f2065906976675808364ddbd1c0f77eea41f.
The initial import commit failed to retain local changes made to
readline's configure.in (and the commit message erroneously stated that
there were no local changes that needed to be reapplied). Also the
import caused a couple of build errors and a scattering of testsuite
regressions throughout many arches. It's probably better to start over
with this import, hopefully more carefully next time.
Diffstat (limited to 'readline/nls.c')
-rw-r--r-- | readline/nls.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/readline/nls.c b/readline/nls.c index d3b3634..e3599eb 100644 --- a/readline/nls.c +++ b/readline/nls.c @@ -43,10 +43,6 @@ # include <locale.h> #endif -#if defined (HAVE_LANGINFO_CODESET) -# include <langinfo.h> -#endif - #include <ctype.h> #include "rldefs.h" @@ -54,8 +50,6 @@ #include "rlshell.h" #include "rlprivate.h" -static int utf8locale PARAMS((char *)); - #if !defined (HAVE_SETLOCALE) /* A list of legal values for the LANG or LC_CTYPE environment variables. If a locale name in this list is the value for the LC_ALL, LC_CTYPE, @@ -78,9 +72,8 @@ static char *legal_lang_values[] = }; static char *normalize_codeset PARAMS((char *)); -#endif /* !HAVE_SETLOCALE */ - static char *find_codeset PARAMS((char *, size_t *)); +#endif /* !HAVE_SETLOCALE */ static char *_rl_get_locale_var PARAMS((const char *)); @@ -98,26 +91,7 @@ _rl_get_locale_var (v) return lspec; } - -static int -utf8locale (lspec) - char *lspec; -{ - char *cp; - size_t len; - -#if HAVE_LANGINFO_CODESET - cp = nl_langinfo (CODESET); - return (STREQ (cp, "UTF-8") || STREQ (cp, "utf8")); -#else - cp = find_codeset (lspec, &len); - - if (cp == 0 || len < 4 || len > 5) - return 0; - return ((len == 5) ? strncmp (cp, "UTF-8", len) == 0 : strncmp (cp, "utf8", 4) == 0); -#endif -} - + /* Check for LC_ALL, LC_CTYPE, and LANG and use the first with a value to decide the defaults for 8-bit character input and output. Returns 1 if we set eight-bit mode. */ @@ -142,9 +116,6 @@ _rl_init_eightbit () lspec = ""; t = setlocale (LC_CTYPE, lspec); - if (t && *t) - _rl_utf8locale = utf8locale (t); - if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0)) { _rl_meta_flag = 1; @@ -226,7 +197,6 @@ normalize_codeset (codeset) return retval; } -#endif /* !HAVE_SETLOCALE */ /* Isolate codeset portion of locale specification. */ static char * @@ -279,3 +249,4 @@ find_codeset (name, lenp) return result; } +#endif /* !HAVE_SETLOCALE */ |