mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
Fix for error messages when loading completions
This commit is contained in:
10
env.h
10
env.h
@@ -100,6 +100,7 @@ class env_var_t : public wcstring {
|
||||
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 @@ class env_var_t : public wcstring {
|
||||
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);
|
||||
}
|
||||
|
||||
};
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user