Source-Changes-HG archive

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

[src/netbsd-1-5]: src/lib/libcurses pullup 1.9 -> 1.10 (approved by releng-1-5)



details:   https://anonhg.NetBSD.org/src/rev/732e95010a67
branches:  netbsd-1-5
changeset: 489388:732e95010a67
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Sep 05 17:11:06 2000 +0000

description:
pullup 1.9 -> 1.10 (approved by releng-1-5)

change behavior of waddnstr(w, s, 0) to be more conformant to XCURSES.
(see comment for detail)

diffstat:

 lib/libcurses/addnstr.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 4e7af76fe3f6 -r 732e95010a67 lib/libcurses/addnstr.c
--- a/lib/libcurses/addnstr.c   Tue Sep 05 02:52:12 2000 +0000
+++ b/lib/libcurses/addnstr.c   Tue Sep 05 17:11:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addnstr.c,v 1.9 2000/04/17 12:25:45 blymn Exp $        */
+/*     $NetBSD: addnstr.c,v 1.9.4.1 2000/09/05 17:11:06 itojun Exp $   */
 
 /*
  * Copyright (c) 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)addnstr.c  8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addnstr.c,v 1.9 2000/04/17 12:25:45 blymn Exp $");
+__RCSID("$NetBSD: addnstr.c,v 1.9.4.1 2000/09/05 17:11:06 itojun Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -139,7 +139,15 @@
        size_t  len;
        const char *p;
 
-       if (n > 0)
+       /*
+        * behavior changed from traditional BSD curses, for better XCURSES
+        * conformance.
+        * 
+        * BSD curses: if (n > 0) then "at most n", else "len = strlen(s)"
+        * ncurses: if (n >= 0) then "at most n", else "len = strlen(s)"
+        * XCURSES: if (n != -1) then "at most n", else "len = strlen(s)"
+        */
+       if (n >= 0)
                for (p = s, len = 0; n-- && *p++; ++len);
        else
                len = strlen(s);



Home | Main Index | Thread Index | Old Index