2a0ae3315db98d137de547e2cb9adfbc38263e6c

Author
Matt Lewin <matt.lewin@gotruemotion.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(genpass): fix grep regex in `genpass-xkcd` for FreeBSD version (#9514)

Diff

 1diff --git a/plugins/genpass/genpass.plugin.zsh b/plugins/genpass/genpass.plugin.zsh
 2index 65bbd2e488fbeb5c794a4ae70db41b7e128db25f..e7f86bf7a1a4dd46ba0426e9152f21b4212dad37 100644
 3--- a/plugins/genpass/genpass.plugin.zsh
 4+++ b/plugins/genpass/genpass.plugin.zsh
 5@@ -80,7 +80,7 @@ genpass-xkcd() {
 6   [[ $1 =~ '^[0-9]+$' ]] && num=$1 || num=1
 7 
 8   # Get all alphabetic words of at most 6 characters in length
 9-  local dict=$(LC_ALL=C grep -E '^[a-zA-Z]{,6}$' /usr/share/dict/words)
10+  local dict=$(LC_ALL=C grep -E '^[a-zA-Z]{1,6}$' /usr/share/dict/words)
11 
12   # Calculate the base-2 entropy of each word in $dict
13   # Entropy is e = L * log2(C), where L is the length of the password (here,