YAMF2.2: Handle indirect results of "kbdcontrol -h X"

where X < 25.
This commit is contained in:
Brian Somers 1997-07-07 13:42:42 +00:00
parent f29c83010d
commit b43f9ca153
3 changed files with 21 additions and 12 deletions

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.219 1997/06/29 22:23:32 ache Exp $
* $Id: syscons.c,v 1.220 1997/06/30 13:31:49 yokota Exp $
*/
#include "sc.h"
@ -775,7 +775,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
}
else {
free(scp->scr_buf, M_DEVBUF);
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
free(scp, M_DEVBUF);
console[minor(dev)] = NULL;
}
@ -957,7 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;
if (scp->history_size < scp->ysize)
scp->history = NULL;
@ -3127,7 +3129,8 @@ scgetc(u_int flags)
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
ptr += cur_console->xsize;
if (ptr + cur_console->xsize >
if (cur_console->history &&
ptr + cur_console->xsize >
cur_console->history +
cur_console->history_size)
ptr = cur_console->history;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.219 1997/06/29 22:23:32 ache Exp $
* $Id: syscons.c,v 1.220 1997/06/30 13:31:49 yokota Exp $
*/
#include "sc.h"
@ -775,7 +775,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
}
else {
free(scp->scr_buf, M_DEVBUF);
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
free(scp, M_DEVBUF);
console[minor(dev)] = NULL;
}
@ -957,7 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;
if (scp->history_size < scp->ysize)
scp->history = NULL;
@ -3127,7 +3129,8 @@ scgetc(u_int flags)
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
ptr += cur_console->xsize;
if (ptr + cur_console->xsize >
if (cur_console->history &&
ptr + cur_console->xsize >
cur_console->history +
cur_console->history_size)
ptr = cur_console->history;

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.219 1997/06/29 22:23:32 ache Exp $
* $Id: syscons.c,v 1.220 1997/06/30 13:31:49 yokota Exp $
*/
#include "sc.h"
@ -775,7 +775,8 @@ scclose(dev_t dev, int flag, int mode, struct proc *p)
}
else {
free(scp->scr_buf, M_DEVBUF);
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
free(scp, M_DEVBUF);
console[minor(dev)] = NULL;
}
@ -957,7 +958,8 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
case CONS_HISTORY: /* set history size */
if (*data) {
free(scp->history, M_DEVBUF);
if (scp->history != NULL)
free(scp->history, M_DEVBUF);
scp->history_size = *(int*)data;
if (scp->history_size < scp->ysize)
scp->history = NULL;
@ -3127,7 +3129,8 @@ scgetc(u_int flags)
(cur_console->xsize*i),
cur_console->xsize * sizeof(u_short));
ptr += cur_console->xsize;
if (ptr + cur_console->xsize >
if (cur_console->history &&
ptr + cur_console->xsize >
cur_console->history +
cur_console->history_size)
ptr = cur_console->history;