diff options
Diffstat (limited to 'src/pinentry.rs')
-rw-r--r-- | src/pinentry.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pinentry.rs b/src/pinentry.rs index aced54f..ff778e7 100644 --- a/src/pinentry.rs +++ b/src/pinentry.rs @@ -47,10 +47,10 @@ pub async fn getpin( crate::error::FailedToParsePinentryUtf8 { out: out.clone() }, )?; for line in out_str.lines() { - if line.starts_with("OK") { - continue; - } else if line.starts_with("D ") { + if line.starts_with("D ") { return Ok(line[2..line.len()].to_string()); + } else if !line.starts_with("OK") { + break; } } |