merge strcpy_truncate branch

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5027 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-06-09 19:25:40 +00:00
parent e255dfc950
commit a5f54865d4
87 changed files with 689 additions and 499 deletions

View File

@@ -23,6 +23,7 @@
#include <config.h>
#include "editline.h"
#include <ctype.h>
#include <errno.h>
RCSID("$Id$");
@@ -177,10 +178,11 @@ TTYstring(unsigned char *p)
TTYshow(*p++);
}
static unsigned int
static int
TTYget()
{
unsigned char c;
char c;
int e;
TTYflush();
if (Pushed) {
@@ -189,7 +191,12 @@ TTYget()
}
if (*Input)
return *Input++;
return read(0, &c, (size_t)1) == 1 ? c : EOF;
do {
e = read(0, &c, 1);
} while(e < 0 && errno == EINTR);
if(e == 1)
return c;
return EOF;
}
#define TTYback() (backspace ? TTYputs((unsigned char *)backspace) : TTYput('\b'))