mirror of
https://github.com/anope/anope.git
synced 2026-07-02 06:26:38 +02:00
Fixed reading empty config values in the multiconfig code, caused by removal of DT_CHARPTR
This commit is contained in:
+2
-8
@@ -56,6 +56,8 @@ class CoreExport ValueItem
|
||||
/** Actual data */
|
||||
Anope::string v;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueItem();
|
||||
/** Initialize with an int */
|
||||
ValueItem(int);
|
||||
/** Initialize with a bool */
|
||||
@@ -64,14 +66,6 @@ class CoreExport ValueItem
|
||||
ValueItem(const Anope::string &);
|
||||
/** Initialize with a long */
|
||||
ValueItem(long);
|
||||
/** Change value to a char pointer */
|
||||
//void Set(char *);
|
||||
/** Change value to a const char pointer */
|
||||
void Set(const char *);
|
||||
/** Change value to an std::string */
|
||||
void Set(const std::string &);
|
||||
/** Change value to a ci::string */
|
||||
void Set(const ci::string &);
|
||||
/** Change value to an Anope::string */
|
||||
void Set(const Anope::string &);
|
||||
/** Change value to an int */
|
||||
|
||||
+6
-19
@@ -1247,7 +1247,7 @@ void ServerConfig::Read()
|
||||
if (ConfValue(hash, configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], configitems.MultiValues[Index].items_default[valuenum], tagnum, item, allow_newlines))
|
||||
vl.push_back(ValueItem(item));
|
||||
else
|
||||
vl.push_back(ValueItem(""));
|
||||
vl.push_back(ValueItem());
|
||||
ValidateNoSpaces(vl[vl.size() - 1].GetValue(), configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum]);
|
||||
break;
|
||||
}
|
||||
@@ -1257,7 +1257,7 @@ void ServerConfig::Read()
|
||||
if (ConfValue(hash, configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], configitems.MultiValues[Index].items_default[valuenum], tagnum, item, allow_newlines))
|
||||
vl.push_back(ValueItem(item));
|
||||
else
|
||||
vl.push_back(ValueItem(""));
|
||||
vl.push_back(ValueItem());
|
||||
ValidateHostname(vl[vl.size() - 1].GetValue(), configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum]);
|
||||
break;
|
||||
}
|
||||
@@ -1267,7 +1267,7 @@ void ServerConfig::Read()
|
||||
if (ConfValue(hash, configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], configitems.MultiValues[Index].items_default[valuenum], tagnum, item, allow_newlines))
|
||||
vl.push_back(ValueItem(item));
|
||||
else
|
||||
vl.push_back(ValueItem(""));
|
||||
vl.push_back(ValueItem());
|
||||
ValidateIP(vl[vl.size() - 1].GetValue(), configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], allow_wild);
|
||||
break;
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ void ServerConfig::Read()
|
||||
if (ConfValue(hash, configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], configitems.MultiValues[Index].items_default[valuenum], tagnum, item, allow_newlines))
|
||||
vl.push_back(ValueItem(item));
|
||||
else
|
||||
vl.push_back(ValueItem(""));
|
||||
vl.push_back(ValueItem());
|
||||
break;
|
||||
}
|
||||
case DT_INTEGER:
|
||||
@@ -1734,6 +1734,8 @@ int ServerConfig::ConfVarEnum(ConfigDataHash &target, const Anope::string &tag,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ValueItem::ValueItem() { }
|
||||
|
||||
ValueItem::ValueItem(int value) : v("")
|
||||
{
|
||||
std::stringstream n;
|
||||
@@ -1757,21 +1759,6 @@ ValueItem::ValueItem(bool value) : v("")
|
||||
|
||||
ValueItem::ValueItem(const Anope::string &value) : v(value) { }
|
||||
|
||||
void ValueItem::Set(const char *value)
|
||||
{
|
||||
v = value;
|
||||
}
|
||||
|
||||
void ValueItem::Set(const std::string &value)
|
||||
{
|
||||
v = value;
|
||||
}
|
||||
|
||||
void ValueItem::Set(const ci::string &value)
|
||||
{
|
||||
v = value;
|
||||
}
|
||||
|
||||
void ValueItem::Set(const Anope::string &value)
|
||||
{
|
||||
v = value;
|
||||
|
||||
@@ -25,6 +25,8 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore) : Flags<
|
||||
if (o == NULL)
|
||||
o = Oper::Find(this->nc->display);
|
||||
this->nc->o = o;
|
||||
if (this->nc->o != NULL)
|
||||
Log() << "Tied oper " << this->nc->display << " to type " << this->nc->o->ot->GetName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user