Removed bool operator, and changed operator char *() to return NULL in case of NULL string, which makes if conditions to work properly.

Require full recompile. (no whatsnew)
This commit is contained in:
Miodrag Milanovic 2010-08-22 11:07:03 +00:00
parent c808af4ee4
commit 0bd74f6269

View File

@ -333,8 +333,7 @@ public:
astring &reset() { return cpy(""); }
astring &expand(int length) { astring_expand(this, length); return *this; }
operator bool() const { return this->text[0] != 0; }
operator char *() { return this->text; }
operator char *() { return (this->text[0] != 0) ? this->text : NULL; }
operator const char *() const { return astring_c(this); }
const char *cstr() const { return astring_c(this); }
int len() const { return astring_len(this); }