1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

don't require readline

(This used to be commit 2dbe70da8db548b3423c6c0de0f282fdf82f0fad)
This commit is contained in:
Andrew Tridgell 2000-01-07 03:02:13 +00:00
parent e91ceacb6c
commit 112faa49e6

View File

@ -158,12 +158,24 @@ static void info_tdb(void)
printf("%d records totalling %d bytes\n", count, total_bytes);
}
static char *getline(char *prompt)
{
static char line[1024];
char *p;
fputs(prompt, stdout);
line[0] = 0;
p = fgets(line, sizeof(line)-1, stdin);
if (p) p = strchr(p, '\n');
if (p) *p = 0;
return p?line:NULL;
}
int main(int argc, char *argv[])
{
char *line;
char *tok;
while ((line=readline("tdb> "))) {
while ((line=getline("tdb> "))) {
tok = strtok(line," ");
if (strcmp(tok,"create") == 0) {
create_tdb();