Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Note that delwin(3) is a null-op if win is NULL.



details:   https://anonhg.NetBSD.org/src/rev/2f4eb2a6105b
branches:  trunk
changeset: 790513:2f4eb2a6105b
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Oct 15 22:15:17 2013 +0000

description:
Note that delwin(3) is a null-op if win is NULL.

diffstat:

 lib/libcurses/curses_window.3 |  9 +++++++--
 lib/libcurses/delwin.c        |  8 ++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r 216d0c5f8c53 -r 2f4eb2a6105b lib/libcurses/curses_window.3
--- a/lib/libcurses/curses_window.3     Tue Oct 15 19:27:48 2013 +0000
+++ b/lib/libcurses/curses_window.3     Tue Oct 15 22:15:17 2013 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: curses_window.3,v 1.15 2011/09/15 12:01:18 wiz Exp $
+.\"    $NetBSD: curses_window.3,v 1.16 2013/10/15 22:15:17 roy Exp $
 .\"
 .\" Copyright (c) 2002
 .\"    Brett Lymn (blymn%NetBSD.org@localhost, brett_lymn%yahoo.com.au@localhost)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd September 15, 2011
+.Dd October 15, 2013
 .Dt CURSES_WINDOW 3
 .Os
 .Sh NAME
@@ -143,6 +143,11 @@
 .Fn delwin
 function with the pointer to the window to be deleted in
 .Fa win .
+If
+.Fa win
+is
+.Dv NULL ,
+then no action occurs.
 .Pp
 A window can be moved to a new position by calling the
 .Fn mvwin
diff -r 216d0c5f8c53 -r 2f4eb2a6105b lib/libcurses/delwin.c
--- a/lib/libcurses/delwin.c    Tue Oct 15 19:27:48 2013 +0000
+++ b/lib/libcurses/delwin.c    Tue Oct 15 22:15:17 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: delwin.c,v 1.17 2009/07/22 16:57:14 roy Exp $  */
+/*     $NetBSD: delwin.c,v 1.18 2013/10/15 22:15:17 roy Exp $  */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)delwin.c   8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: delwin.c,v 1.17 2009/07/22 16:57:14 roy Exp $");
+__RCSID("$NetBSD: delwin.c,v 1.18 2013/10/15 22:15:17 roy Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -57,6 +57,10 @@
 #ifdef DEBUG
        __CTRACE(__CTRACE_WINDOW, "delwin(%p)\n", win);
 #endif
+
+       if (win == NULL)
+               return (OK);
+
        /*
         * Free any storage used by non-spacing characters in the window.
         */



Home | Main Index | Thread Index | Old Index