aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-26 01:15:53 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-26 01:15:53 -0800
commit94a764d6ea2d00a1c6fc268a062a59748e676c4c (patch)
treebcb8cf0e93ef366f7afb844088cdb0cb1370589e /env.h
parent38e40862fe338d75b05316f4caf66cf36f4faa6b (diff)
Fix for error messages when loading completions
Diffstat (limited to 'env.h')
-rw-r--r--env.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/env.h b/env.h
index b78015b1..d3fbf44b 100644
--- a/env.h
+++ b/env.h
@@ -100,6 +100,7 @@ private:
bool is_missing;
public:
static env_var_t missing_var(void);
+ env_var_t(const env_var_t &x) : wcstring(x), is_missing(x.is_missing) { }
env_var_t(const wcstring & x) : wcstring(x), is_missing(false) { }
env_var_t(const wchar_t *x) : wcstring(x), is_missing(false) { }
env_var_t() : wcstring(L""), is_missing(false) { }
@@ -111,6 +112,15 @@ public:
wcstring::operator=(s);
return *this;
}
+
+ bool operator==(const env_var_t &s) const {
+ if (is_missing && s.is_missing)
+ return true;
+ else if (s.is_missing || s.is_missing)
+ return false;
+ else
+ return *static_cast<const wcstring *>(this) == *static_cast<const wcstring *>(&s);
+ }
};
/**