#include <string>

#include <config/config.h>
#include <config/config_type_pointer.h>
#include <config/config_value.h>

ConfigTypePointer config_type_pointer;

bool
ConfigTypePointer::set(ConfigValue *cv, const std::string& vstr)
{
	if (pointers_.find(cv) != pointers_.end())
		return (false);

	/* XXX Have a magic None that is easily-detected?  */
	if (vstr == "None") {
		pointers_[cv] = NULL;
		return (true);
	}

	Config *config = cv->config_;
	ConfigObject *co = config->lookup(vstr);
	if (co == NULL)
		return (false);

	pointers_[cv] = co;

	return (true);
}

#include <string>

#include <config/config.h>
#include <config/config_type_pointer.h>
#include <config/config_value.h>

ConfigTypePointer config_type_pointer;

bool
ConfigTypePointer::set(ConfigValue *cv, const std::string& vstr)
{
	if (pointers_.find(cv) != pointers_.end())
		return (false);

	Config *config = cv->config_;
	ConfigObject *co = config->lookup(vstr);
	if (co == NULL)
		return (false);

	pointers_[cv] = co;

	return (true);
}

--- 
+++ 
@@ -12,6 +12,12 @@
 	if (pointers_.find(cv) != pointers_.end())
 		return (false);
 
+	/* XXX Have a magic None that is easily-detected?  */
+	if (vstr == "None") {
+		pointers_[cv] = NULL;
+		return (true);
+	}
+
 	Config *config = cv->config_;
 	ConfigObject *co = config->lookup(vstr);
 	if (co == NULL)
Support pointers to "None" as used in the wanproxy.conf.


git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@173 4068ffdb-0463-0410-8185-8cc71e3bd399
