Module Name: src
Committed By: blymn
Date: Sun Jun 30 22:16:20 UTC 2019
Modified Files:
src/lib/libcurses: fileio.h scanw.c shlib_version
Log Message:
Fix return for mvscanw to return ERR/OK instead of the number of
elements scanned, now matches SUSv2 specification
Bump lib major due to return change.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/fileio.h
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/scanw.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libcurses/shlib_version
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libcurses/fileio.h
diff -u src/lib/libcurses/fileio.h:1.6 src/lib/libcurses/fileio.h:1.7
--- src/lib/libcurses/fileio.h:1.6 Mon May 20 22:17:41 2019
+++ src/lib/libcurses/fileio.h Sun Jun 30 22:16:20 2019
@@ -4,5 +4,5 @@
* by : NetBSD: genfileioh.awk,v 1.2 2008/05/02 11:13:02 martin Exp
*/
-#define CURSES_LIB_MAJOR 7
+#define CURSES_LIB_MAJOR 8
#define CURSES_LIB_MINOR 2
Index: src/lib/libcurses/scanw.c
diff -u src/lib/libcurses/scanw.c:1.22 src/lib/libcurses/scanw.c:1.23
--- src/lib/libcurses/scanw.c:1.22 Fri Jan 6 13:53:18 2017
+++ src/lib/libcurses/scanw.c Sun Jun 30 22:16:20 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: scanw.c,v 1.22 2017/01/06 13:53:18 roy Exp $ */
+/* $NetBSD: scanw.c,v 1.23 2019/06/30 22:16:20 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)scanw.c 8.3 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: scanw.c,v 1.22 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: scanw.c,v 1.23 2019/06/30 22:16:20 blymn Exp $");
#endif
#endif /* not lint */
@@ -116,9 +116,16 @@ int
vw_scanw(WINDOW *win, const char *fmt, va_list ap)
{
char buf[1024];
+ int ret;
- return wgetnstr(win, buf, (int) sizeof(buf)) == OK ?
- vsscanf(buf, fmt, ap) : ERR;
+ ret = ERR;
+ if (wgetnstr(win, buf, (int) sizeof(buf)) == OK) {
+ if (vsscanf(buf, fmt, ap) > 0) {
+ ret = OK;
+ }
+ }
+
+ return ret;
}
__strong_alias(vwscanw, vw_scanw)
Index: src/lib/libcurses/shlib_version
diff -u src/lib/libcurses/shlib_version:1.43 src/lib/libcurses/shlib_version:1.44
--- src/lib/libcurses/shlib_version:1.43 Fri Nov 16 10:12:00 2018
+++ src/lib/libcurses/shlib_version Sun Jun 30 22:16:20 2019
@@ -1,8 +1,8 @@
-# $NetBSD: shlib_version,v 1.43 2018/11/16 10:12:00 blymn Exp $
+# $NetBSD: shlib_version,v 1.44 2019/06/30 22:16:20 blymn Exp $
# Remember to update distrib/sets/lists/base/shl.* when changing
# Remember to run `make fileio.h` when changing
# Remember to increment the major numbers of libform, libmenu and
# libpanel when the libcurses major number increments.
#
-major=7
+major=8
minor=2