From d64bc6bd87a1d34a10ef9a8fc6c9a707e32e5a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=BB=D0=B0=20=D0=93=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D1=83=D1=88=D0=BA=D0=BE?= Date: Wed, 22 Nov 2023 21:08:37 +0300 Subject: [PATCH] fix masking input when there is no hintsCallback from orig commit ec5e4e8 --- components/console/linenoise/linenoise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/console/linenoise/linenoise.c b/components/console/linenoise/linenoise.c index b216c67..5741a82 100644 --- a/components/console/linenoise/linenoise.c +++ b/components/console/linenoise/linenoise.c @@ -593,7 +593,8 @@ int linenoiseEditInsert(struct linenoiseState *l, char c) { if ((!mlmode && l->plen+l->len < l->cols && !hintsCallback)) { /* Avoid a full update of the line in the * trivial case. */ - if (fwrite(&c,1,1,stdout) == -1) return -1; + char d = (maskmode==1) ? '*' : c; + if (fwrite(&d,1,1,stdout) == -1) return -1; } else { refreshLine(l); }