Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses handle the case where we have no space properl...



details:   https://anonhg.NetBSD.org/src/rev/4638e39c74f6
branches:  trunk
changeset: 773080:4638e39c74f6
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 27 15:37:09 2012 +0000

description:
handle the case where we have no space properly (Nat Sloss)

diffstat:

 lib/libcurses/getstr.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (39 lines):

diff -r 404590369777 -r 4638e39c74f6 lib/libcurses/getstr.c
--- a/lib/libcurses/getstr.c    Fri Jan 27 15:28:32 2012 +0000
+++ b/lib/libcurses/getstr.c    Fri Jan 27 15:37:09 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getstr.c,v 1.21 2012/01/06 22:20:54 christos Exp $     */
+/*     $NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $     */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)getstr.c   8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getstr.c,v 1.21 2012/01/06 22:20:54 christos Exp $");
+__RCSID("$NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -241,17 +241,14 @@
                        wmove(win, win->cury, xpos);
                } else {
                        if (remain) {
-                               if (iscntrl((unsigned char)c)) {
+                               if (iscntrl((unsigned char)c))
                                        mvwaddch(win, win->cury, xpos, ' ');
-                                       wmove(win, win->cury, xpos + 1);
-                               }
                                str++;
                                xpos++;
                                remain--;
-                       } else {
+                       } else
                                mvwaddch(win, win->cury, xpos, ' ');
-                               wmove(win, win->cury, xpos - 1);
-                       }
+                       wmove(win, win->cury, xpos);
                }
        }
 



Home | Main Index | Thread Index | Old Index