Skip LF when piping

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët 2020-04-28 12:41:35 +00:00
parent ddbe7cf3f3
commit a5d3dd5b4f

View file

@ -382,7 +382,7 @@ s_do(int argc, char **argv, void *data)
secret[i] = '!' + secret[i] % (1U + '~' - '!');
s_write(1, secret, len);
s_write(1, "\n", 1);
if (isatty(1)) s_write(1, "\n", 1);
} else {
if (!s_input(secret, sizeof(secret), "Secret: "))
s_exit(0);