Style cleanup

This commit is contained in:
drduh 2015-07-03 13:05:06 -04:00
parent e3a3c78464
commit 4ddbc34b96
1 changed files with 5 additions and 6 deletions

11
pwd.sh
View File

@ -26,21 +26,20 @@ get_pass () {
while IFS= read -p "${prompt}" -r -s -n 1 char ; do
if [[ ${char} == $'\0' ]] ; then
break
fi
if [[ ${char} == $'\177' ]]; then
if [[ -z "${password}" ]]; then
prompt=''
elif [[ ${char} == $'\177' ]] ; then
if [[ -z "${password}" ]] ; then
prompt=""
else
prompt=$'\b \b'
password="${password%?}"
fi
else
prompt='*'
prompt="*"
password+="${char}"
fi
done
if [ -z ${password+x} ] ; then
if [[ -z ${password} ]] ; then
fail "No password provided"
fi
}