mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 12:31:45 +08:00
Minor fixes from changeset a5f54865d41c3f181a06 from Heimdal project http://github.com/heimdal/heimdal
This commit is contained in:
parent
cc1fd1e9dc
commit
b51dad6408
@ -186,10 +186,9 @@ char *default_rl_complete(char *pathname, int *unique)
|
||||
j = strlen(av[0]) - len + 2;
|
||||
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]);
|
||||
len = strlen(dir) + strlen(av[0]) + 2;
|
||||
if ((new = NEW(char, len)) != NULL) {
|
||||
snprintf(new, len, "%s/%s", dir, av[0]);
|
||||
rl_add_slash(new, p);
|
||||
DISPOSE(new);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ static void tty_string(char *p)
|
||||
|
||||
static int tty_get(void)
|
||||
{
|
||||
char c;
|
||||
char c;
|
||||
int r;
|
||||
|
||||
tty_flush();
|
||||
@ -194,9 +194,10 @@ static int tty_get(void)
|
||||
return *Input++;
|
||||
do
|
||||
{
|
||||
r= read(0, &c, (SIZE_T)1);
|
||||
r = read(0, &c, 1);
|
||||
} while (r == -1 && errno == EINTR);
|
||||
return r == 1 ? c : EOF;
|
||||
|
||||
return r == 1 ? c : EOF;
|
||||
}
|
||||
|
||||
#define tty_back() (backspace ? tty_puts(backspace) : tty_put('\b'))
|
||||
|
Loading…
Reference in New Issue
Block a user