diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-14 04:18:22 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-12-14 04:18:22 +0000 |
| commit | 34fa0973611c929a22ea016ed691c4e152ba0054 (patch) | |
| tree | 847efbc26da98e40996b574823937dee071c800d /gnu/lib/libdialog | |
| parent | 6c544102301514eaa304d68513b87d959c326e0e (diff) | |
Notes
Diffstat (limited to 'gnu/lib/libdialog')
| -rw-r--r-- | gnu/lib/libdialog/checklist.c | 8 | ||||
| -rw-r--r-- | gnu/lib/libdialog/menubox.c | 9 | ||||
| -rw-r--r-- | gnu/lib/libdialog/radiolist.c | 6 |
3 files changed, 16 insertions, 7 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index e5f9ddde517d..5db04c789d3d 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -18,8 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * */ +#ifndef lint +static const char rcsid[] = "$FreeBSD$"; +#endif #include <dialog.h> #include "dialog.priv.h" @@ -251,9 +255,9 @@ draw: /* Check if key pressed matches first character of any item tag in list */ for (i = 0; i < max_choice; i++) - if (key < 0x100 && toupper(key) == toupper(items[(scroll+i)*3][0])) + if (isprint(key) && key < 0x100 && toupper(key) == toupper(items[(scroll+i)*3][0])) break; - + if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) || KEY_IS_UP(key) || KEY_IS_DOWN(key) || key == ' ') { diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c index 9a5b0c254ebd..77b82eed7ca3 100644 --- a/gnu/lib/libdialog/menubox.c +++ b/gnu/lib/libdialog/menubox.c @@ -20,6 +20,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef lint +static const char rcsid[] = "$FreeBSD$"; +#endif #include <dialog.h> #include "dialog.priv.h" @@ -229,10 +232,10 @@ draw: } /* Check if key pressed matches first character of any item tag in menu */ - for (i = 0; i < max_choice; i++) - if (key < 0x100 && toupper(key) == toupper(items[(scroll + i) * 2][0])) + for (i = 0; i < max_choice; i++) + if (key < 0x100 && isprint(key) && toupper(key) == toupper(items[(scroll + i) * 2][0])) break; - + if (i < max_choice || (key >= '1' && key <= MIN('9', '0'+max_choice)) || KEY_IS_UP(key) || KEY_IS_DOWN(key)) { if (key >= '1' && key <= MIN('9', '0'+max_choice)) i = key - '1'; diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index f894e9276d30..c1f5ce6566db 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -21,6 +21,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef lint +static const char rcsid[] = "$FreeBSD$"; +#endif #include <dialog.h> #include "dialog.priv.h" @@ -262,9 +265,8 @@ draw: /* Check if key pressed matches first character of any item tag in list */ for (i = 0; i < max_choice; i++) - if (toupper(key) == toupper(items[(scroll + i) * 3][0])) + if (isprint(key) && toupper(key) == toupper(items[(scroll + i) * 3][0])) break; - if (i < max_choice || (key >= '1' && key <= MIN('9', '0' + max_choice)) || KEY_IS_UP(key) || KEY_IS_DOWN(key) || key == ' ') { if (key >= '1' && key <= MIN('9', '0' + max_choice)) |
