X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_setup.c;h=16f05ae0b1a201d586cbc0986a1b4e002cfbae58;hp=298f08ecd4a94eb074ef6c254ff032c868075d06;hb=30393be892025f03322b7907a04cc05cc08e8760;hpb=02c4e383be9337e73a0e75844dfd1047745adb28 diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 298f08ec..16f05ae0 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.192 2018/04/07 21:10:20 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.195 2018/09/01 21:16:23 tom Exp $") /**************************************************************************** * @@ -543,9 +543,9 @@ _nc_get_locale(void) */ env = setlocale(LC_CTYPE, 0); #else - if (((env = getenv("LC_ALL")) != 0 && *env != '\0') + if (((env = getenv("LANG")) != 0 && *env != '\0') || ((env = getenv("LC_CTYPE")) != 0 && *env != '\0') - || ((env = getenv("LANG")) != 0 && *env != '\0')) { + || ((env = getenv("LC_ALL")) != 0 && *env != '\0')) { ; } #endif @@ -560,7 +560,7 @@ NCURSES_EXPORT(int) _nc_unicode_locale(void) { int result = 0; -#if defined(__MINGW32__) && USE_WIDEC_SUPPORT +#if defined(_WIN32) && USE_WIDEC_SUPPORT result = 1; #elif HAVE_LANGINFO_CODESET char *env = nl_langinfo(CODESET); @@ -714,6 +714,16 @@ TINFO_SETUP_TERM(TERMINAL **tp, ret_error0(TGETENT_ERR, "Not enough memory to create terminal structure.\n"); } +#if HAVE_SYSCONF +#ifdef LINE_MAX + _nc_globals.getstr_limit = LINE_MAX; +#endif +#ifdef _SC_LINE_MAX + _nc_globals.getstr_limit = sysconf(_SC_LINE_MAX); +#endif +#endif /* HAVE_SYSCONF */ + T(("using %d for getstr limit", _nc_globals.getstr_limit)); + #ifdef USE_TERM_DRIVER INIT_TERM_DRIVER(); TCB = (TERMINAL_CONTROL_BLOCK *) termp;