From: Danilo Rezende Date: Thu, 27 Feb 2025 11:04:40 +0000 (-0300) Subject: fix no delimiter being used sometimes X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=86365da147f7c380e4230851a4fd0f5b2a3b8d42;p=redacted-XKCD-password-generator.git fix no delimiter being used sometimes The command `xkcdpass --random-delimiters --valid-delimiters=...` sometimes would output words using the empty string as as delimiter. This commit makes it so that when --valid-delimiters is passed, only the delimiters specified are used, without adding an empty string in addition to those. Closes #165. --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index b8337b2..ef2d87c 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -422,7 +422,7 @@ def emit_passwords(wordlist, options): """ Generate the specified number of passwords and output them. """ count = options.count if options.valid_delimiters: - valid_delimiters = list(options.valid_delimiters) + [""] + valid_delimiters = list(options.valid_delimiters) else: valid_delimiters = DEFAULT_DELIMITERS while count > 0: