Commit b1b14c22 by lager

fix getting user's home dir

When running binwalk in non-interactive session some env variables
may not be set. This causes binwalk to fail to correctly determine
user's home directory. This commit fixes that (at least for linux systems).
parent a0c5315f
......@@ -132,6 +132,8 @@ class Settings(object):
user_dir = os.getenv(envname)
if user_dir is not None:
return user_dir
if os.path.expanduser("~") is Not None:
return os.path.expanduser("~")
except KeyboardInterrupt as e:
raise e
except Exception:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment