Merge pull request #34 from Ma27/pass-first-line-only

This commit is contained in:
FliegendeWurst 2022-08-14 13:39:27 +02:00 committed by GitHub
commit f0bce36ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,8 +201,8 @@ pub fn ask_user_pass(opt: &Opt) -> Result<(String, String)> {
))? ))?
} else { } else {
pass = String::from_utf8(pw_out.stdout).map(|x| { pass = String::from_utf8(pw_out.stdout).map(|x| {
x.trim_end().to_string() x.lines().next().map(|x| x.to_owned()).ok_or_else(|| anyhow!("empty pass(1) entry!"))
}).expect("utf-8 decode of `pass(1)`-output failed"); })?.expect("utf-8 decode of `pass(1)`-output failed");
should_store = false; should_store = false;
} }
} else { } else {