diff -Nur ncurses-4.2/ncurses/tinfo/read_termcap.c ncurses-4.2.orig/ncurses/tinfo/read_termcap.c --- ncurses-4.2/ncurses/tinfo/read_termcap.c Tue Dec 8 20:47:42 1998 +++ ncurses-4.2.orig/ncurses/tinfo/read_termcap.c Tue Dec 8 20:47:13 1998 @@ -1039,8 +1039,11 @@ for (i = 0; i < filecount; i++) { T(("Looking for %s in %s", tn, termpaths[i])); - if ((fp = fopen(termpaths[i], "r")) != (FILE *)0) + if ((_nc_access(termpaths[i], R_OK) < 0) + || (fp = fopen(termpaths[i], "r")) == (FILE *)0) { + T(("Could not open %s (error %d)", termpaths[i], errno)); + } else { _nc_set_source(termpaths[i]); /*