mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 09:31:29 +08:00
constref more things
Thanks @ridiculousfish!
This commit is contained in:
parent
4dc1c6ca39
commit
b2b4ab4bab
@ -804,7 +804,7 @@ wcstring reformat_for_screen(const wcstring &msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Escape a string in a fashion suitable for using as a URL. Store the result in out_str.
|
/// Escape a string in a fashion suitable for using as a URL. Store the result in out_str.
|
||||||
static void escape_string_url(wcstring in, wcstring &out) {
|
static void escape_string_url(const wcstring &in, wcstring &out) {
|
||||||
for (auto& c1 : in) {
|
for (auto& c1 : in) {
|
||||||
// This silliness is so we get the correct result whether chars are signed or unsigned.
|
// This silliness is so we get the correct result whether chars are signed or unsigned.
|
||||||
unsigned int c2 = (unsigned int)c1 & 0xFF;
|
unsigned int c2 = (unsigned int)c1 & 0xFF;
|
||||||
@ -854,7 +854,7 @@ static bool unescape_string_url(const wchar_t *in, wcstring *out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Escape a string in a fashion suitable for using as a fish var name. Store the result in out_str.
|
/// Escape a string in a fashion suitable for using as a fish var name. Store the result in out_str.
|
||||||
static void escape_string_var(const wcstring in, wcstring &out) {
|
static void escape_string_var(const wcstring &in, wcstring &out) {
|
||||||
bool prev_was_hex_encoded = false;
|
bool prev_was_hex_encoded = false;
|
||||||
for (auto c1 : in) {
|
for (auto c1 : in) {
|
||||||
// This silliness is so we get the correct result whether chars are signed or unsigned.
|
// This silliness is so we get the correct result whether chars are signed or unsigned.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user