Hide secret information

This commit is contained in:
Valera Cogut
2018-10-18 11:15:35 +03:00
parent 4ec7d26a9d
commit 4784fe2491
3 changed files with 26 additions and 1 deletions

View File

@@ -162,7 +162,10 @@ static void tty_flush(void)
return;
if (!el_no_echo) {
res = write(el_outfd, Screen, ScreenCount);
if (rl_check_secret(rl_line_buffer))
res = write(el_outfd, "", 1);
else
res = write(el_outfd, Screen, ScreenCount);
if (res > 0)
ScreenCount = 0;
}
@@ -1134,6 +1137,10 @@ static void hist_add(const char *p)
if (s == NULL)
return;
// Don't add secret information in history
if (rl_check_secret(s))
return;
if (H.Size < el_hist_size) {
H.Lines[H.Size++] = s;
} else {