mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-31 23:28:45 +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.
|
/// Escape specified string.
|
||||||
static wcstring full_escape(const wchar_t *in) {
|
static wcstring full_escape(const wcstring &in) {
|
||||||
wcstring out;
|
wcstring out;
|
||||||
for (; *in; in++) {
|
for (wchar_t c : in) {
|
||||||
wchar_t c = *in;
|
|
||||||
if (is_universal_safe_to_encode_directly(c)) {
|
if (is_universal_safe_to_encode_directly(c)) {
|
||||||
out.push_back(c);
|
out.push_back(c);
|
||||||
} else if (c <= (wchar_t)ASCII_MAX) {
|
} 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.
|
// 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());
|
debug(0, L"Could not convert %ls to narrow character string", val_in.c_str());
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue