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

@@ -10,3 +10,10 @@ Sun Apr 19 09:53:46 1998 Assar Westerlund <assar@sics.se>
* Makefile.in: add symlink magic for linux
Sat Feb 7 07:24:30 1998 Assar Westerlund <assar@sics.se>
* editline.h: add prototypes
Tue Feb 3 10:24:22 1998 Johan Danielsson <joda@emma.pdc.kth.se>
* editline.c: If read returns EINTR, try again.

View File

@@ -169,9 +169,8 @@ rl_complete(pathname, unique)
if ((p = NEW(char, j + 1)) != NULL) {
COPYFROMTO(p, av[0] + len, j);
if ((new = NEW(char, strlen(dir) + strlen(av[0]) + 2)) != NULL) {
(void)strcpy(new, dir);
(void)strcat(new, "/");
(void)strcat(new, av[0]);
snprintf (new, sizeof(new),
"%s/%s", dir, av[0]);
rl_add_slash(new, p);
DISPOSE(new);
}

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'))

View File

@@ -53,7 +53,7 @@ extern int rl_erase;
extern int rl_intr;
extern int rl_kill;
extern int rl_quit;
extern char *rl_complete();
extern int rl_list_possib();
extern void rl_ttyset();
extern void rl_add_slash();
extern char *rl_complete(char *, int *);
extern int rl_list_possib(char *, char ***);
extern void rl_ttyset(int);
extern void rl_add_slash(char *, char *);