diff options
author | 2024-10-20 20:29:10 +0300 | |
---|---|---|
committer | 2024-11-22 20:48:31 +0300 | |
commit | a9aafc121f3f8f6cc8c090fdadc67155771e753e (patch) | |
tree | e97a8846ed93edc89bb8ffc234b8dc0cc3fdc569 /src/dirbrowserformaction.cpp | |
parent | f271339aa1c9d55c2865b379d39b423faf22365e (diff) | |
download | newsboat-feature/2326-filepath.tar.gz newsboat-feature/2326-filepath.tar.zst newsboat-feature/2326-filepath.zip |
Avoid passing non-UTF-8 data to strprintf::fmt in {File,Dir}Browserfeature/2326-filepath
Diffstat (limited to 'src/dirbrowserformaction.cpp')
-rw-r--r-- | src/dirbrowserformaction.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dirbrowserformaction.cpp b/src/dirbrowserformaction.cpp index 49cda190..bb3d0004 100644 --- a/src/dirbrowserformaction.cpp +++ b/src/dirbrowserformaction.cpp @@ -325,12 +325,13 @@ void DirBrowserFormAction::add_directory( std::string DirBrowserFormAction::get_formatted_dirname(const Filepath& dirname, mode_t mode) { - std::string tmp = dirname.to_locale_string(); + const auto dirname_str = dirname.display(); const auto suffix = file_system::mode_suffix(mode); if (suffix.has_value()) { - tmp += std::to_string(suffix.value()); + return strprintf::fmt("%s%c", dirname_str, suffix.value()); + } else { + return dirname_str; } - return tmp; } std::string DirBrowserFormAction::title() |