From dc4eb5bb4a81c8dbe312bd0f79721fe3a3dd6af8 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Thu, 20 Jan 2011 09:30:29 +0100 Subject: [PATCH] Fixing ssl-cert-{sha512,sha256,sha1,md5}() These functions are generated in a loop. However, the way they were generated was broken. The loop variable is *not* replaced by a literal string in the resulting functions. Therefore, as soon as the variable is unset all functions become broken. Luckily, they broke loudly. Otherwise this may not have been caught easily. Reported-by: Michael Gebetsroither Signed-off-by: Frank Terbeck --- etc/zsh/zshrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index decda2b..0b82cb3 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3079,14 +3079,14 @@ exit 0; ssl_hashes=( sha512 sha256 sha1 md5 ) for sh in ${ssl_hashes}; do - ssl-cert-${sh}() { + eval 'ssl-cert-'${sh}'() { emulate -L zsh if [[ -z $1 ]] ; then - printf 'usage: %s \n' "ssh-cert-${sh}" + printf '\''usage: %s \n'\'' "ssh-cert-'${sh}'" return 1 fi - openssl x509 -noout -fingerprint -${sh} -in $1 - } + openssl x509 -noout -fingerprint -'${sh}' -in $1 + }' done; unset sh ssl-cert-fingerprints() { -- 2.1.4