X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/e608805f43dff8a516e106fc3d9349e7276d81ec..4d8ae757b2662eca9e0d49c3fb27e69fb85cab85:/src/termcap.c diff --git a/src/termcap.c b/src/termcap.c index 472005f139..b99ae47331 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -1,5 +1,6 @@ /* Work-alike for termcap, plus extra features. - Copyright (C) 1985, 86, 93, 94, 95 Free Software Foundation, Inc. + Copyright (C) 1985, 86, 93, 94, 95, 2000, 2001 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -288,11 +289,12 @@ tgetst1 (ptr, area) /* Outputting a string with padding. */ -short ospeed; /* If OSPEED is 0, we use this as the actual baud rate. */ int tputs_baud_rate; char PC; +#if 0 /* Doesn't seem to be used anymore. */ + /* Actual baud rate if positive; - baud rate / 100 if negative. */ @@ -307,6 +309,8 @@ static int speeds[] = #endif /* not VMS */ }; +#endif /* 0 */ + void tputs (str, nlines, outfun) register char *str; @@ -316,21 +320,12 @@ tputs (str, nlines, outfun) register int padcount = 0; register int speed; -#ifdef emacs extern int baud_rate; speed = baud_rate; /* For quite high speeds, convert to the smaller units to avoid overflow. */ if (speed > 10000) speed = - speed / 100; -#else - if (ospeed == 0) - speed = tputs_baud_rate; - else if (ospeed > 0 && ospeed < (sizeof speeds / sizeof speeds[0])) - speed = speeds[ospeed]; - else - speed = 0; -#endif if (!str) return; @@ -453,7 +448,7 @@ tgetent (bp, name) char *term; int malloc_size = 0; register int c; - char *tcenv; /* TERMCAP value, if it contains :tc=. */ + char *tcenv = NULL; /* TERMCAP value, if it contains :tc=. */ char *indirect = NULL; /* Terminal type in :tc= in TERMCAP value. */ int filep; @@ -565,11 +560,11 @@ tgetent (bp, name) /* If BP is malloc'd by us, make sure it is big enough. */ if (malloc_size) { - malloc_size = bp1 - bp + buf.size; - termcap_name = (char *) xrealloc (bp, malloc_size); - bp1 += termcap_name - bp; - tc_search_point += termcap_name - bp; - bp = termcap_name; + int offset1 = bp1 - bp, offset2 = tc_search_point - bp; + malloc_size = offset1 + buf.size; + bp = termcap_name = (char *) xrealloc (bp, malloc_size); + bp1 = termcap_name + offset1; + tc_search_point = termcap_name + offset2; } /* Copy the line of the entry from buf into bp. */