aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/getpass.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/getpass.c b/src/getpass.c
index 225f7f04e..77e950c9d 100644
--- a/src/getpass.c
+++ b/src/getpass.c
@@ -203,6 +203,11 @@ char *getpass_r(const char *prompt, char *buffer, int buflen)
buffer[i] = 0;
break;
}
+ else
+ if ( buffer[i] == '\b')
+ /* remove this letter and if this is not the first key, remove the
+ previous one as well */
+ i = i - (i>=1?2:1);
}
/* if user didn't hit ENTER, terminate buffer */
if (i==buflen)