Simplify isnull to use case

This commit is contained in:
root 2013-02-14 00:00:00 +00:00
parent d6df0f1453
commit da65f512a7

View file

@ -29,7 +29,7 @@ echo_git() { xecho "$@" ; } # Code clarity
echo_info() { xecho "gcrypt:" "$@" >&2; } echo_info() { xecho "gcrypt:" "$@" >&2; }
echo_die() { echo_info "$@" ; exit 1; } echo_die() { echo_info "$@" ; exit 1; }
isnull() { [ 0 = "${#1}" ]; } isnull() { case "${1}" in "") true;; *) false;; esac; }
isnonnull() { ! isnull "$1"; } isnonnull() { ! isnull "$1"; }
iseq() { isnull "${1#"$2"}"; } iseq() { isnull "${1#"$2"}"; }
isnoteq() { ! iseq "$@"; } isnoteq() { ! iseq "$@"; }