Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HiddenInput::new() calls tcgetattr twice #95

Open
abacabadabacaba opened this issue Feb 14, 2024 · 1 comment
Open

HiddenInput::new() calls tcgetattr twice #95

abacabadabacaba opened this issue Feb 14, 2024 · 1 comment

Comments

@abacabadabacaba
Copy link

Here:

rpassword/src/lib.rs

Lines 76 to 77 in 49e3f3a

let mut term = safe_tcgetattr(fd)?;
let term_orig = safe_tcgetattr(fd)?;

This makes an extra syscall, even though the value can be just Copyed.

@conradkleinespel
Copy link
Owner

conradkleinespel commented Feb 15, 2024

Indeed, you're right, thanks for pointing it out! 👍

Feel free to provide a pull request with a fix. I don't have time to work on this at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants