diff options
Diffstat (limited to 'ncurses/base/lib_touch.c')
-rw-r--r-- | ncurses/base/lib_touch.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ncurses/base/lib_touch.c b/ncurses/base/lib_touch.c index 20ac9450f15f..451606483b86 100644 --- a/ncurses/base/lib_touch.c +++ b/ncurses/base/lib_touch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,16 +43,19 @@ #include <curses.priv.h> -MODULE_ID("$Id: lib_touch.c,v 1.12 2012/06/09 20:29:33 tom Exp $") +MODULE_ID("$Id: lib_touch.c,v 1.15 2017/11/21 00:14:26 tom Exp $") + +#undef is_linetouched NCURSES_EXPORT(bool) is_linetouched(WINDOW *win, int line) { T((T_CALLED("is_linetouched(%p,%d)"), (void *) win, line)); - /* XSI doesn't define any error */ - if (!win || (line > win->_maxy) || (line < 0)) - returnCode((bool) ERR); + /* XSI doesn't define any error, and gcc ultimately made it impossible */ + if (!win || (line > win->_maxy) || (line < 0)) { + returnCode(FALSE); + } returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE); } @@ -60,14 +63,15 @@ is_linetouched(WINDOW *win, int line) NCURSES_EXPORT(bool) is_wintouched(WINDOW *win) { - int i; - T((T_CALLED("is_wintouched(%p)"), (void *) win)); - if (win) + if (win) { + int i; + for (i = 0; i <= win->_maxy; i++) if (win->_line[i].firstchar != _NOCHANGE) returnCode(TRUE); + } returnCode(FALSE); } |