From: Thomas E. Dickey Date: Sun, 7 Aug 2022 09:47:59 +0000 (+0000) Subject: ncurses 6.3 - patch 20220806 X-Git-Tag: v6.4~22 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=768f77851c2350c02252b8e0e5d69fc435940b83 ncurses 6.3 - patch 20220806 + amend end_of_stream() to allow for input files without a final newline. + check for non-textfiles to tic. --- diff --git a/NEWS b/NEWS index 5c10a393..9b1a9040 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3839 2022/07/28 20:18:34 tom Exp $ +-- $Id: NEWS,v 1.3841 2022/08/06 19:13:14 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,11 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20220806 + + amend end_of_stream() to allow for input files without a final + newline. + + check for non-textfiles to tic. + 20220729 + fixes to build with dietlibc: + add configure check for fpathconf (report by Georg Lehner). diff --git a/VERSION b/VERSION index af24f36f..f473b9bf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.3 20220729 +5:0:10 6.3 20220806 diff --git a/dist.mk b/dist.mk index ee53cc54..f3390b9a 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1495 2022/07/29 19:45:25 tom Exp $ +# $Id: dist.mk,v 1.1496 2022/08/06 10:14:36 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 3 -NCURSES_PATCH = 20220729 +NCURSES_PATCH = 20220806 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 1d9a9985..71361c50 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -51,7 +51,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.116 2022/05/08 00:11:44 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.119 2022/08/07 00:20:26 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -149,6 +149,32 @@ last_char(int from_end) return result; } +/* + * Read, like fgets(), but error-out if the input contains nulls. + */ +static int +get_text(char *buffer, int length) +{ + int count = 0; + int limit = length - 1; + + while (limit-- > 0) { + int ch = fgetc(yyin); + + if (ch == '\0') { + _nc_err_abort("This is not a text-file"); + } else if (ch == EOF) { + break; + } + ++count; + *buffer++ = (char) ch; + if (ch == '\n') + break; + } + *buffer = '\0'; + return count; +} + /* * int next_char() * @@ -214,7 +240,7 @@ next_char(void) if (used == 0) _nc_curr_file_pos = ftell(yyin); - if (fgets(result + used, (int) (allocated - used), yyin) != 0) { + if (get_text(result + used, (int) (allocated - used))) { bufstart = result; if (used == 0) { if (_nc_curr_line == 0 @@ -292,7 +318,9 @@ static bool end_of_stream(void) /* are we at end of input? */ { - return ((yyin ? feof(yyin) : (bufptr && *bufptr == '\0')) + return ((yyin + ? (feof(yyin) && (bufptr == NULL || *bufptr == '\0')) + : (bufptr && *bufptr == '\0')) ? TRUE : FALSE); } diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 4cd745f8..1e32b6ca 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20220729) unstable; urgency=low +ncurses6 (6.3+20220806) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 26 Jul 2022 10:04:04 -0400 + -- Thomas E. Dickey Sat, 06 Aug 2022 06:14:36 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 4cd745f8..1e32b6ca 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20220729) unstable; urgency=low +ncurses6 (6.3+20220806) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 26 Jul 2022 10:04:04 -0400 + -- Thomas E. Dickey Sat, 06 Aug 2022 06:14:36 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 2851ee06..c0d2c646 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20220729) unstable; urgency=low +ncurses6 (6.3+20220806) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 26 Jul 2022 10:04:04 -0400 + -- Thomas E. Dickey Sat, 06 Aug 2022 06:14:36 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index d0d244cb..f3bfa139 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.535 2022/07/26 14:04:04 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.536 2022/08/06 10:14:36 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "3" !define VERSION_YYYY "2022" -!define VERSION_MMDD "0729" +!define VERSION_MMDD "0806" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 9a4303bd..ae2e3ca9 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.3 -Release: 20220729 +Release: 20220806 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index ed4a8af2..812e7abe 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.3 -Release: 20220729 +Release: 20220806 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 8e993211..c2f80db5 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.3 -Release: 20220729 +Release: 20220806 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz