diff util/human/io.lua @ 14119:519c16c2eb21 13.0

util.human.io: Trim any trailing newline from password entry Newlines are invalid in passwords anyway, according to saslprep. Trailing newlines can happen when pasting, e.g. when copying the output of command-line password managers/generators to the clipboard.
author Matthew Wild <mwild1@gmail.com>
date Thu, 02 Apr 2026 20:49:37 +0100
parents 82513890a1d8
children 7008869fcce2 7eb0e47418ab
line wrap: on
line diff
--- a/util/human/io.lua	Fri Mar 27 12:45:38 2026 +0000
+++ b/util/human/io.lua	Thu Apr 02 20:49:37 2026 +0100
@@ -43,7 +43,7 @@
 	end
 	io.write("\n");
 	if ok then
-		return pass;
+		return (pass:gsub("\n$", ""));
 	end
 end