From b8053ff61cb34cd2e962a66f49750e66d53d0ab5 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 17 May 2013 15:33:00 +0200 Subject: bin/hostinfo: ignore HOSTINFO_PATH if its empty If the environment variable HOSTINFO_PATH is an empty string it is now handled as if the variable is unset. With this you can overwrite a global value in the shell simply with the following command: HOSTINFO_PATH="" hostinfo ... --- bin/hostinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hostinfo b/bin/hostinfo index 43fd5b4..88fe388 100755 --- a/bin/hostinfo +++ b/bin/hostinfo @@ -89,7 +89,7 @@ def print_help(self_name): def main(): self_name = sys.argv.pop(0) basepath = '/usr/local/share/hostinfo' - if 'HOSTINFO_PATH' in os.environ: + if 'HOSTINFO_PATH' in os.environ and os.environ['HOSTINFO_PATH'] != '': basepath = os.environ['HOSTINFO_PATH'] file = oneline = keys = verbose = nospaces = help = \ -- cgit v1.2.3-1-g7c22