fix no delimiter being used sometimes
authorDanilo Rezende <redacted>
Thu, 27 Feb 2025 11:04:40 +0000 (08:04 -0300)
committerDanilo Rezende <redacted>
Thu, 27 Feb 2025 12:27:35 +0000 (09:27 -0300)
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.

xkcdpass/xkcd_password.py

index b8337b23f00b00693d13e28428d84b63b187fd82..ef2d87c04c2d74c1b7de88fa2b8521c064d7092c 100755 (executable)
@@ -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:
git clone https://git.99rst.org/PROJECT