aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/string_tools.cpp
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2024-08-14 16:13:35 +0200
committertobtoht <tob@featherwallet.org>2024-08-14 16:57:49 +0200
commitc7d4bf491e9f9fc1f5c5cd08759ef6020a025170 (patch)
tree4e58dd56a1064be61a70a5406e6d8f3c070555c4 /contrib/epee/src/string_tools.cpp
parentc6d17a0b3938270b997f199e19ab47d4c2b41a83 (diff)
downloadmonzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.tar.gz
monzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.tar.xz
monzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.zip
epee: string_tools: remove dot from get_extension
Fixes a regression introduced in #9254. Previously it did not include the dot.
Diffstat (limited to 'contrib/epee/src/string_tools.cpp')
-rw-r--r--contrib/epee/src/string_tools.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/epee/src/string_tools.cpp b/contrib/epee/src/string_tools.cpp
index 4458dabdd..7ab3002b9 100644
--- a/contrib/epee/src/string_tools.cpp
+++ b/contrib/epee/src/string_tools.cpp
@@ -201,7 +201,12 @@ namespace string_tools
std::string get_extension(const std::string& str)
{
- return boost::filesystem::path(str).extension().string();
+ std::string ext_with_dot = boost::filesystem::path(str).extension().string();
+
+ if (ext_with_dot.empty())
+ return {};
+
+ return ext_with_dot.erase(0, 1);
}
//----------------------------------------------------------------------------