interrogate_terminfo: allow for NULL termtype

pull/2197/head
nick black 3 years ago committed by nick black
parent 8f4fa30e7b
commit 24eac43f4f

@ -785,7 +785,8 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
// machines, but they'll use the terminfo installed thereon (putty, etc.).
int termerr;
if(setupterm(termtype, ti->ttyfd, &termerr)){
logpanic("Terminfo error %d for %s (see terminfo(3ncurses))\n", termerr, termtype);
logpanic("Terminfo error %d for [%s] (see terminfo(3ncurses))\n",
termerr, termtype ? termtype : "");
goto err;
}
tname = termname(); // longname() is also available

@ -212,7 +212,7 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out,
unsigned nonewfonts, int* cursor_y, int* cursor_x,
struct ncsharedstats* stats, int lmargin, int tmargin,
unsigned draininput)
__attribute__ ((nonnull (1, 2, 3, 10)));
__attribute__ ((nonnull (1, 3, 10)));
void free_terminfo_cache(tinfo* ti);

@ -0,0 +1,24 @@
#!/bin/sh
set -e
# interactive tester for Notcurses. runs a variety of programs, which the
# user must inspect for correct output -- i.e. these do not check their
# own output for correctness =[. it ought be run from a notcurses build
# directory, with all binaries built.
DATA=../data # FIXME
OUT=$(basename 0).log # FIXME
rm -f "$OUT"
[ -d "$DATA" ] || { echo "$DATA was not a directory" >&2 ; exit 1 ; }
# this ought process the entire file, then allow the user to exit with ^D
./notcurses-input -v < ../src/lib/in.c 2>>"$OUT"
# goes through a series of self-described bitmap frames
./bitmapstates 2>>"$OUT"
./statepixel "$DATA"/worldmap.jpg 2>>"$OUT"
./ncneofetch -v 2>>"$OUT"
Loading…
Cancel
Save