Luck Call made win32 password prompting support backspace

This commit is contained in:
Daniel Stenberg 2004-01-13 16:07:40 +00:00
parent 4a4295290d
commit 9e80356dd5
3 changed files with 10 additions and 1 deletions

View file

@ -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)