diff options
author | valmat <ufabiz@gmail.com> | 2014-04-10 13:04:34 +0600 |
---|---|---|
committer | valmat <ufabiz@gmail.com> | 2014-04-10 13:04:34 +0600 |
commit | 14b63ee87dde3688fea7e58fa25b73362117ae11 (patch) | |
tree | 0611b2d6ccc4edfb27e350f4925cbe169c2520a7 /zend | |
parent | 1a6b709b8f732ea8a91b07a74f64928e0484b1f6 (diff) |
Fixed problem with duplicate names ini entries.
Mentioned https://github.com/CopernicaMarketingSoftware/PHP-CPP/issues/64#issuecomment-39838004
Now in the case of duplication name of ini entriy the new value overrides the old one. Before was incorrect handling of this situation.
Diffstat (limited to 'zend')
-rw-r--r-- | zend/includes.h | 1 | ||||
-rw-r--r-- | zend/ini.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/zend/includes.h b/zend/includes.h index e7dece9..4aa5eb0 100644 --- a/zend/includes.h +++ b/zend/includes.h @@ -15,6 +15,7 @@ #include <initializer_list> #include <vector> #include <map> +#include <set> #include <memory> #include <list> #include <exception> diff --git a/zend/ini.cpp b/zend/ini.cpp index e6a9888..0c04d6a 100644 --- a/zend/ini.cpp +++ b/zend/ini.cpp @@ -21,8 +21,8 @@ namespace Php { { ini_entry->module_number = module_number; ini_entry->modifiable = static_cast<int>(this->_place); - ini_entry->name = const_cast<char*>(this->_name); - ini_entry->name_length = strlen(this->_name)+1; + ini_entry->name = const_cast<char*>(this->_name.c_str()); + ini_entry->name_length = this->_name.size()+1; ini_entry->on_modify = OnUpdateString; ini_entry->mh_arg1 = nullptr; #ifdef ZTS |