summaryrefslogtreecommitdiff
path: root/src/option.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-13 01:53:33 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-13 01:53:33 -0400
commitc0fd8d5e152c910b64c8d3536864d033d4ac9ffc (patch)
treea3d950c7f2315ad947ed404ee144044585d0f6da /src/option.cc
parentf594bf787a6f2d2aca5127d972fc8546a2c8e05f (diff)
downloadfork-ledger-c0fd8d5e152c910b64c8d3536864d033d4ac9ffc.tar.gz
fork-ledger-c0fd8d5e152c910b64c8d3536864d033d4ac9ffc.tar.bz2
fork-ledger-c0fd8d5e152c910b64c8d3536864d033d4ac9ffc.zip
If a LEDGER_ envvar has no value, ignore it
Diffstat (limited to 'src/option.cc')
-rw-r--r--src/option.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/option.cc b/src/option.cc
index b45fc87b..1a68d2a8 100644
--- a/src/option.cc
+++ b/src/option.cc
@@ -126,7 +126,9 @@ void process_environment(const char ** envp, const string& tag,
if (*q == '=') {
try {
- process_option(string(buf), scope, q + 1, string(*p, q - *p));
+ string value = string(*p, q - *p);
+ if (! value.empty())
+ process_option(string(buf), scope, q + 1, value);
}
catch (const std::exception& err) {
add_error_context("While parsing environment variable option '"