diff options
author | 2023-09-17 14:08:30 -0400 | |
---|---|---|
committer | 2023-09-17 14:08:57 -0400 | |
commit | 0c8dbef887e8a968213e8f5e23a74b2c9fef916f (patch) | |
tree | 69d54c6ac9acfcc8a77e7dc5ceb66b679b3f8930 /src/lib/formats/fs_fat.cpp | |
parent | 01040b1e0ce4d6f74de97de5c47ea6d8cf12ab48 (diff) |
fsmgr.cpp: Restore trim_end_spaces as a std::string_view function and use it in place of strtrimrightspace in FS code due to feedback on f5066881db7a601ba7031fbc996ab404e05e5dd5
Diffstat (limited to 'src/lib/formats/fs_fat.cpp')
-rw-r--r-- | src/lib/formats/fs_fat.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/formats/fs_fat.cpp b/src/lib/formats/fs_fat.cpp index 15977d72b0a..990ce7b4fe0 100644 --- a/src/lib/formats/fs_fat.cpp +++ b/src/lib/formats/fs_fat.cpp @@ -142,9 +142,8 @@ #include "fs_fat.h" #include "pc_dsk.h" + #include "strformat.h" -#include "util/corestr.h" -#include "util/strformat.h" using namespace fs; @@ -449,8 +448,8 @@ std::unique_ptr<filesystem_t> fs::fat_image::mount_partition(fsblk_t &blockdev, std::string directory_entry::name() const { - std::string_view stem = strtrimrightspace(raw_stem()); - std::string_view ext = strtrimrightspace(raw_ext()); + std::string_view stem = filesystem_t::trim_end_spaces(raw_stem()); + std::string_view ext = filesystem_t::trim_end_spaces(raw_ext()); return !ext.empty() ? util::string_format("%s.%s", stem, ext) : std::string(stem); @@ -711,8 +710,8 @@ void impl::iterate_directory_entries(const directory_span &dir, const std::funct if (dirent.raw_stem()[0] != 0x00) { // get the filename - std::string_view stem = strtrimrightspace(dirent.raw_stem()); - std::string_view ext = strtrimrightspace(dirent.raw_ext()); + std::string_view stem = trim_end_spaces(dirent.raw_stem()); + std::string_view ext = trim_end_spaces(dirent.raw_ext()); if (ext.empty() && (stem == "." || stem == "..")) continue; |