Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses Fix return for mvscanw to return ERR/OK instea...
details: https://anonhg.NetBSD.org/src/rev/eebc379c32cb
branches: trunk
changeset: 962158:eebc379c32cb
user: blymn <blymn%NetBSD.org@localhost>
date: Sun Jun 30 22:16:20 2019 +0000
description:
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.
diffstat:
lib/libcurses/fileio.h | 2 +-
lib/libcurses/scanw.c | 15 +++++++++++----
lib/libcurses/shlib_version | 4 ++--
3 files changed, 14 insertions(+), 7 deletions(-)
diffs (61 lines):
diff -r 6c3e9ea18037 -r eebc379c32cb lib/libcurses/fileio.h
--- a/lib/libcurses/fileio.h Sun Jun 30 22:15:06 2019 +0000
+++ b/lib/libcurses/fileio.h Sun Jun 30 22:16:20 2019 +0000
@@ -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
diff -r 6c3e9ea18037 -r eebc379c32cb lib/libcurses/scanw.c
--- a/lib/libcurses/scanw.c Sun Jun 30 22:15:06 2019 +0000
+++ b/lib/libcurses/scanw.c Sun Jun 30 22:16:20 2019 +0000
@@ -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 @@
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)
diff -r 6c3e9ea18037 -r eebc379c32cb lib/libcurses/shlib_version
--- a/lib/libcurses/shlib_version Sun Jun 30 22:15:06 2019 +0000
+++ b/lib/libcurses/shlib_version Sun Jun 30 22:16:20 2019 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index