Properly implement DO_NOT_MODIFY_CACHE
This fixes node_to_string() by making sure the node is really not modified.
This commit is contained in:
parent
0aa93bf94c
commit
6bc7a80b5d
1 changed files with 9 additions and 3 deletions
|
@ -756,12 +756,16 @@ void node::output(char*& buf, CACHE_STATUS cache_status)
|
|||
|
||||
for(std::vector<attribute>::iterator i = attr_.begin(); i != attr_.end(); ++i) {
|
||||
memcpy(buf, i->key.begin(), i->key.size());
|
||||
i->key = string_span(buf, i->key.size());
|
||||
if(cache_status == REFRESH_CACHE) {
|
||||
i->key = string_span(buf, i->key.size());
|
||||
}
|
||||
buf += i->key.size();
|
||||
*buf++ = '=';
|
||||
*buf++ = '"';
|
||||
memcpy(buf, i->value.begin(), i->value.size());
|
||||
i->value = string_span(buf, i->value.size());
|
||||
if(cache_status == REFRESH_CACHE) {
|
||||
i->value = string_span(buf, i->value.size());
|
||||
}
|
||||
buf += i->value.size();
|
||||
*buf++ = '"';
|
||||
*buf++ = '\n';
|
||||
|
@ -774,7 +778,9 @@ void node::output(char*& buf, CACHE_STATUS cache_status)
|
|||
string_span& attr = children_[i->child_map_index].first;
|
||||
*buf++ = '[';
|
||||
memcpy(buf, attr.begin(), attr.size());
|
||||
attr = string_span(buf, attr.size());
|
||||
if(cache_status == REFRESH_CACHE) {
|
||||
attr = string_span(buf, attr.size());
|
||||
}
|
||||
buf += attr.size();
|
||||
*buf++ = ']';
|
||||
*buf++ = '\n';
|
||||
|
|
Loading…
Add table
Reference in a new issue