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;
|
j = strlen(av[0]) - len + 2;
|
||||||
if ((p = NEW(char, j + 1)) != NULL) {
|
if ((p = NEW(char, j + 1)) != NULL) {
|
||||||
COPYFROMTO(p, av[0] + len, j);
|
COPYFROMTO(p, av[0] + len, j);
|
||||||
if ((new = NEW(char, strlen(dir) + strlen(av[0]) + 2)) != NULL) {
|
len = strlen(dir) + strlen(av[0]) + 2;
|
||||||
(void)strcpy(new, dir);
|
if ((new = NEW(char, len)) != NULL) {
|
||||||
(void)strcat(new, "/");
|
snprintf(new, len, "%s/%s", dir, av[0]);
|
||||||
(void)strcat(new, av[0]);
|
|
||||||
rl_add_slash(new, p);
|
rl_add_slash(new, p);
|
||||||
DISPOSE(new);
|
DISPOSE(new);
|
||||||
}
|
}
|
||||||
|
@ -194,8 +194,9 @@ static int tty_get(void)
|
|||||||
return *Input++;
|
return *Input++;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
r= read(0, &c, (SIZE_T)1);
|
r = read(0, &c, 1);
|
||||||
} while (r == -1 && errno == EINTR);
|
} while (r == -1 && errno == EINTR);
|
||||||
|
|
||||||
return r == 1 ? c : EOF;
|
return r == 1 ? c : EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user