--- src/vt.c.orig Sat Jan 25 17:55:02 1997 +++ src/vt.c Sat Aug 7 05:09:15 1999 @@ -185,6 +185,11 @@ static void VtSetMode(u_char mode, bool sw) { switch(mode) { +#if defined(__FreeBSD__) + case 1: + con.cursor_key_mode = sw; + break; +#endif case 4: con.ins = sw; break; @@ -654,4 +659,144 @@ con.sb = lInfo.sb; con.db = lInfo.db|LATCH_1; con.active = cInfo.sw = TRUE; +#if defined(__FreeBSD__) + con.cursor_key_mode = FALSE; +#endif } + +#if defined(__FreeBSD__) + +static int ReplaceString(char *sp, const int len, const int maxlen, + const int oldlen, const char *newstr) +{ + int newlen, copylen, diff; + + newlen = strlen(newstr); + diff = newlen - oldlen; + copylen = len - oldlen; + + if(len + diff > maxlen){ + diff -= (len + diff - maxlen); + copylen = maxlen - newlen; + } + if(copylen > 0) + memcpy(sp + newlen, sp + oldlen, copylen); + + copylen = newlen; + if(newlen > maxlen){ + copylen = maxlen; + diff = maxlen - len; + } + if(copylen > 0) + memcpy(sp, newstr, copylen); + + return(diff); +} + +int cons25tovt100(u_char *buff, int len, const int max) +{ + u_char *p; + int i; + int newlen = len; + + p = buff; + + for(i=0; i