From: Ian Jackson Date: Wed, 2 Jun 2021 16:40:43 +0000 (+0100) Subject: otter cli: sshkeys: Get line numbers right X-Git-Tag: otter-0.7.0~109 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=82c97226f424d35130fc49bbc071e1a0e9785183;p=otter.git otter cli: sshkeys: Get line numbers right Signed-off-by: Ian Jackson --- diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 85422e06..77277b6a 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -2059,7 +2059,7 @@ mod set_ssh_keys { }; let akf = BufReader::new(akf); - for (lno, l) in akf.lines().enumerate() { + for (l, lno) in akf.lines().zip(1..) { let l = l.context("read KEYS-FILE")?; let l = l.trim(); if l.starts_with("#") || l == "" { continue }