summaryrefslogtreecommitdiff
path: root/lib/libcurses/tinfo
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-01-31 20:17:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-01-31 20:17:11 +0000
commitfb70e89dae9574330a73792f0fceddfab62202b9 (patch)
tree18b545328dd6256be0c7c1201cf94a31446e9d16 /lib/libcurses/tinfo
parent3b9b932e9a8c5afd5438f8d93bf20a7f032d8847 (diff)
ncurses-4.2-990130
Diffstat (limited to 'lib/libcurses/tinfo')
-rw-r--r--lib/libcurses/tinfo/lib_baudrate.c25
-rw-r--r--lib/libcurses/tinfo/lib_data.c8
2 files changed, 21 insertions, 12 deletions
diff --git a/lib/libcurses/tinfo/lib_baudrate.c b/lib/libcurses/tinfo/lib_baudrate.c
index 97b5eb7c5be..d0c946d20fa 100644
--- a/lib/libcurses/tinfo/lib_baudrate.c
+++ b/lib/libcurses/tinfo/lib_baudrate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_baudrate.c,v 1.1 1999/01/18 19:10:16 millert Exp $ */
+/* $OpenBSD: lib_baudrate.c,v 1.2 1999/01/31 20:17:10 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -43,7 +43,7 @@
#include <term.h> /* cur_term, pad_char */
#include <termcap.h> /* ospeed */
-MODULE_ID("$From: lib_baudrate.c,v 1.14 1999/01/03 01:31:45 tom Exp $")
+MODULE_ID("$From: lib_baudrate.c,v 1.15 1999/01/31 03:05:25 tom Exp $")
/*
* int
@@ -103,16 +103,25 @@ static struct speed const speeds[] = {
int _nc_baudrate(int OSpeed)
{
- int result = ERR;
+ static int last_OSpeed;
+ static int last_baudrate;
+
+ int result;
unsigned i;
- if (OSpeed >= 0) {
- for (i = 0; i < SIZEOF(speeds); i++) {
- if (speeds[i].s == (speed_t)OSpeed) {
- result = speeds[i].sp;
- break;
+ if (OSpeed == last_OSpeed) {
+ result = last_baudrate;
+ } else {
+ result = ERR;
+ if (OSpeed >= 0) {
+ for (i = 0; i < SIZEOF(speeds); i++) {
+ if (speeds[i].s == (speed_t)OSpeed) {
+ result = speeds[i].sp;
+ break;
+ }
}
}
+ last_baudrate = result;
}
return (result);
}
diff --git a/lib/libcurses/tinfo/lib_data.c b/lib/libcurses/tinfo/lib_data.c
index 9fad1c97b3e..f686f40b4da 100644
--- a/lib/libcurses/tinfo/lib_data.c
+++ b/lib/libcurses/tinfo/lib_data.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: lib_data.c,v 1.1 1999/01/18 19:10:17 millert Exp $ */
+/* $OpenBSD: lib_data.c,v 1.2 1999/01/31 20:17:10 millert Exp $ */
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999 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 *
@@ -42,7 +42,7 @@
#include <curses.priv.h>
-MODULE_ID("$From: lib_data.c,v 1.13 1998/02/11 12:14:00 tom Exp $")
+MODULE_ID("$From: lib_data.c,v 1.14 1999/01/31 01:34:33 Ilya.Zakharevich Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
@@ -82,5 +82,5 @@ void _nc_set_screen(SCREEN *sp)
my_screen = sp;
}
#else
-SCREEN *SP;
+SCREEN *SP = NULL; /* Some linkers require initialized data... */
#endif