Permalink
Browse files

Fix yesno() implementation.

  • Loading branch information...
1 parent 3bba5d3 commit 8dd6f4f4b8255898ecd358c5719ec52b219ad045 @CasperVector CasperVector committed Aug 24, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/cdm
View
@@ -43,11 +43,12 @@ exiterror() { sleep 1; exit 1; }
yesno()
{
[ -z "$1" ] && return 1
+ eval value=\$${1}
- case "$1" in
+ case "$value" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1;;
- *) warn "\`$1' is not a valid argument for \`yesno'; using \`no' for now."
+ *) warn "Invalid value for \`$1'; falling back to \`no' for now.";;
esac
}

0 comments on commit 8dd6f4f

Please sign in to comment.