We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb60fd0 commit d9ccce2Copy full SHA for d9ccce2
common/common.cpp
@@ -90,6 +90,19 @@ void process_escapes(std::string& input) {
90
case '\'': input[output_idx++] = '\''; break;
91
case '\"': input[output_idx++] = '\"'; break;
92
case '\\': input[output_idx++] = '\\'; break;
93
+ case 'x':
94
+ // Handle \x12, etc
95
+ if (input_idx + 2 < input_len) {
96
+ const char x[3] = { input[input_idx + 1], input[input_idx + 2], 0 };
97
+ char *err_p = nullptr;
98
+ const long val = std::strtol(x, &err_p, 16);
99
+ if (err_p == x + 2) {
100
+ input_idx += 2;
101
+ input[output_idx++] = char(val);
102
+ break;
103
+ }
104
+ // Intentionally fall through to default.
105
106
default: input[output_idx++] = '\\';
107
input[output_idx++] = input[input_idx]; break;
108
}
0 commit comments