mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Remove another unnecessary wcstring->wchar conversion
This commit is contained in:
parent
27c0ee92de
commit
d4db4f40a4
1 changed files with 3 additions and 4 deletions
|
@ -119,10 +119,9 @@ static bool is_universal_safe_to_encode_directly(wchar_t c) {
|
|||
}
|
||||
|
||||
/// Escape specified string.
|
||||
static wcstring full_escape(const wchar_t *in) {
|
||||
static wcstring full_escape(const wcstring &in) {
|
||||
wcstring out;
|
||||
for (; *in; in++) {
|
||||
wchar_t c = *in;
|
||||
for (wchar_t c : in) {
|
||||
if (is_universal_safe_to_encode_directly(c)) {
|
||||
out.push_back(c);
|
||||
} else if (c <= (wchar_t)ASCII_MAX) {
|
||||
|
@ -178,7 +177,7 @@ static bool append_file_entry(fish_message_type_t type, const wcstring &key_in,
|
|||
}
|
||||
|
||||
// Append value.
|
||||
if (success && !append_utf8(full_escape(val_in.c_str()), result, storage)) {
|
||||
if (success && !append_utf8(full_escape(val_in), result, storage)) {
|
||||
debug(0, L"Could not convert %ls to narrow character string", val_in.c_str());
|
||||
success = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue