mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Remove trailing newline in interactive mode.
This commit is contained in:
parent
6cf5882c56
commit
e3c7f0027f
@ -439,7 +439,10 @@ static char *prompt(char *line, int size) {
|
|||||||
retval = fgets(line, size, stdin);
|
retval = fgets(line, size, stdin);
|
||||||
} while (retval && *line == '\n');
|
} while (retval && *line == '\n');
|
||||||
|
|
||||||
|
line[strlen(line) - 1] = '\0';
|
||||||
|
|
||||||
fpurge(stdin);
|
fpurge(stdin);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user