commit c1b3ff04425844ed88fac2a634232bdb8e2662bc
parent 65cead8c0fdb07ce3821f6b97bdcb32684d0c3f7
Author: Daniel Lublin <daniel@lublin.se>
Date: Fri, 15 Sep 2017 10:06:46 +0200
passmenu: Don't eat whitespace at beginning/end of password
If IFS (Input Field Separator) is not emptied, read will actually strip
spaces and tabs at the beginning/end end of the "line".
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
@@ -20,6 +20,6 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
if [[ $typeit -eq 0 ]]; then
pass show -c "$password" 2>/dev/null
else
- pass show "$password" | { read -r pass; printf %s "$pass"; } |
+ pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
xdotool type --clearmodifiers --file -
fi