mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-27 12:11:15 -03:00
Replace \e with \x1B, as the former is a gcc extension
While supported by gcc and clang, \e is a gcc-specific extension and not formally defined in the C or C++ standards. See [0] for a list of valid escapes. [0]: https://stackoverflow.com/a/10220539/17027
This commit is contained in:
@@ -981,7 +981,7 @@ static void escape_string_script(const wchar_t *orig_in, size_t in_len, wcstring
|
||||
need_escape = need_complex_escape = 1;
|
||||
break;
|
||||
}
|
||||
case L'\e': {
|
||||
case L'\x1B': {
|
||||
out += L'\\';
|
||||
out += L'e';
|
||||
need_escape = need_complex_escape = 1;
|
||||
@@ -1243,9 +1243,9 @@ size_t read_unquoted_escape(const wchar_t *input, wcstring *result, bool allow_i
|
||||
}
|
||||
break;
|
||||
}
|
||||
// \e means escape.
|
||||
// \x1B means escape.
|
||||
case L'e': {
|
||||
result_char_or_none = L'\e';
|
||||
result_char_or_none = L'\x1B';
|
||||
break;
|
||||
}
|
||||
// \f means form feed.
|
||||
|
||||
Reference in New Issue
Block a user