mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
constref more things
Thanks @ridiculousfish!
This commit is contained in:
parent
4dc1c6ca39
commit
b2b4ab4bab
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue