mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-25 10:11:17 -03:00
%s -> %ls for wchar_t
I noticed my debug output for 24bit color mode was garbled due to this being wrong. I spent a little time trying to get the compiler to tell us about these, but -Wformat doesn't do anything for wchar printf functions, and __attribute__((format(printf, n, m))) will cause an error with wchar_t's, so I gave up and decided to manually check out every '%s' in the entire project. I found (only) one more. debug(0, "%s", wchars) will report warnings for incorrect specifiers but debug(0, L"%s", wchars) is unable. Thus there may be reason to prefer not using L"..." as an argument if all else is equal and it's not necessary.
This commit is contained in:
@@ -376,7 +376,7 @@ static void update_fish_color_support(const environment_t &vars) {
|
||||
// Handle $fish_term24bit
|
||||
if (auto fish_term24bit = vars.get(L"fish_term24bit")) {
|
||||
support_term24bit = bool_from_string(fish_term24bit->as_string());
|
||||
debug(2, L"'fish_term24bit' preference: 24-bit color %s",
|
||||
debug(2, L"'fish_term24bit' preference: 24-bit color %ls",
|
||||
support_term24bit ? L"enabled" : L"disabled");
|
||||
} else {
|
||||
// We don't attempt to infer term24 bit support yet.
|
||||
|
||||
Reference in New Issue
Block a user