summaryrefslogtreecommitdiff
path: root/src/option.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-10 05:06:16 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-10 05:06:16 -0400
commitbedadd03a0a8ec4b84751104139cc49bede72cbe (patch)
treed99f44866ca942b4345d44ad9f25bb9d34ce1d3a /src/option.h
parent9039cf498694fbda691e6113de53181607ad16ad (diff)
downloadfork-ledger-bedadd03a0a8ec4b84751104139cc49bede72cbe.tar.gz
fork-ledger-bedadd03a0a8ec4b84751104139cc49bede72cbe.tar.bz2
fork-ledger-bedadd03a0a8ec4b84751104139cc49bede72cbe.zip
option_t's copy constructor wasn't copying "wants_arg".
This was causing "reg -p this" to fail in the REPL.
Diffstat (limited to 'src/option.h')
-rw-r--r--src/option.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/option.h b/src/option.h
index 50ba238d..787d34ae 100644
--- a/src/option.h
+++ b/src/option.h
@@ -58,6 +58,8 @@ class option_t
const char ch;
bool handled;
+ option_t& operator=(const option_t&);
+
public:
T * parent;
value_t value;
@@ -75,7 +77,8 @@ public:
ch(other.ch),
handled(other.handled),
parent(NULL),
- value(other.value)
+ value(other.value),
+ wants_arg(other.wants_arg)
{
TRACE_CTOR(option_t, "copy");
}
@@ -103,6 +106,7 @@ public:
string& str() {
assert(handled);
+ assert(value);
return value.as_string_lval();
}