Fix for failing to unescape history properly, resulting in a backslash explosion

This commit is contained in:
ridiculousfish 2012-02-23 10:29:00 -08:00
parent fd56465931
commit f24a0170be
2 changed files with 7 additions and 0 deletions

View File

@ -643,6 +643,10 @@ void history_tests_t::test_history(void) {
/* Generate a value */
wcstring value = wcstring(L"test item ") + format_val(i);
/* Maybe add some backslashes */
if (i % 3 == 0)
value.append(L"(slashies \\\\\\ slashies)");
/* Generate some paths */
path_list_t paths;

View File

@ -287,6 +287,9 @@ static bool extract_prefix(std::string &key, std::string &value, const std::stri
if (val_start < line.size() && line.at(val_start) == ' ')
val_start++;
value = line.substr(val_start);
unescape_yaml(key);
unescape_yaml(value);
}
return where != std::string::npos;
}