/****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.195 2018/09/01 21:16:23 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.199 2019/03/23 23:42:20 tom Exp $")
/****************************************************************************
*
"Not enough memory to create terminal structure.\n");
}
#if HAVE_SYSCONF
+ {
+ long limit;
#ifdef LINE_MAX
- _nc_globals.getstr_limit = LINE_MAX;
+ limit = LINE_MAX;
+#else
+ limit = _nc_globals.getstr_limit;
#endif
#ifdef _SC_LINE_MAX
- _nc_globals.getstr_limit = sysconf(_SC_LINE_MAX);
+ if (limit < sysconf(_SC_LINE_MAX))
+ limit = sysconf(_SC_LINE_MAX);
#endif
+ if (_nc_globals.getstr_limit < (int) limit)
+ _nc_globals.getstr_limit = (int) limit;
+ }
#endif /* HAVE_SYSCONF */
T(("using %d for getstr limit", _nc_globals.getstr_limit));
#else
#if NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP
status = _nc_setup_tinfo(tname, &TerminalType(termp));
+ T(("_nc_setup_tinfo returns %d", status));
#else
+ T(("no database available"));
status = TGETENT_NO;
#endif
const TERMTYPE2 *fallback = _nc_fallback2(tname);
if (fallback) {
- TerminalType(termp) = *fallback;
+ T(("found fallback entry"));
+ _nc_copy_termtype2(&(TerminalType(termp)), fallback);
status = TGETENT_YES;
}
}