diff options
author | 2010-08-16 18:34:27 +0100 | |
---|---|---|
committer | 2010-08-16 18:34:27 +0100 | |
commit | 87ecc0bdd0c41ec9770224b59060987941341570 (patch) | |
tree | ef881d712ef04b0ace17e8926f2fce6da134e5a1 | |
parent | d5b526c6e12744a92b7d2f3ca4facb250a33f7bd (diff) | |
download | paludis-87ecc0bdd0c41ec9770224b59060987941341570.tar.gz paludis-87ecc0bdd0c41ec9770224b59060987941341570.tar.xz |
More fancy escaping for KV
-rw-r--r-- | paludis/util/config_file.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc index 1bfc6e948..53336c5a3 100644 --- a/paludis/util/config_file.cc +++ b/paludis/util/config_file.cc @@ -421,6 +421,8 @@ namespace result.append("\t"); else if (parser.consume(simple_parser::exact("\\n"))) result.append("\n"); + else if (parser.consume(simple_parser::exact("\\e"))) + result.append("\033"); else if (parser.consume(simple_parser::exact("\\") & simple_parser::any_except("") >> s)) result.append(s); else if ((! k.options()[kvcfo_disallow_variables]) && parser.consume(simple_parser::exact("$"))) @@ -507,7 +509,14 @@ namespace need_single_space_unless_eol = false; } - result.append(w); + if (w == "n") + result.append("\n"); + else if (w == "t") + result.append("\t"); + else if (w == "e") + result.append("\033"); + else + result.append(w); } else if (parser.consume((simple_parser::any_except("") & *simple_parser::any_except("\\\"$#\n\t ")) >> w)) { |