Skip to content

Commit

Permalink
epee: partially revert c56ee14 to fix linking errors
Browse files Browse the repository at this point in the history
On Linux Mint 21.3, g++ Ubuntu 11.4.0-1ubuntu1~22.04, I get linking error for an undefined reference to `epee::string_tools::trim_right`. This PR reverts the changes
to epee_readline.cpp in commit c56ee14, which turns a `boost::trim_right` callsite into an `epee::string_tools::trim_right` callsite.
  • Loading branch information
jeffro256 committed May 28, 2024
1 parent cc73fe7 commit b07a97c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
2 changes: 0 additions & 2 deletions contrib/epee/include/string_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ namespace string_tools
std::string get_current_module_path();
#endif
void set_module_name_and_folder(const std::string& path_to_process_);
void trim_left(std::string& str);
void trim_right(std::string& str);
//----------------------------------------------------------------------------
inline std::string& trim(std::string& str)
{
Expand Down
3 changes: 1 addition & 2 deletions contrib/epee/src/readline_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "readline_buffer.h"
#include "string_tools.h"
#include <readline/readline.h>
#include <readline/history.h>
#include <iostream>
Expand Down Expand Up @@ -174,7 +173,7 @@ static void handle_line(char* line)
line_stat = rdln::full;
the_line = line;
std::string test_line = line;
epee::string_tools::trim_right(test_line);
boost::trim_right(test_line);
if(!test_line.empty())
{
if (!same_as_last_line(test_line))
Expand Down
13 changes: 0 additions & 13 deletions contrib/epee/src/string_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,6 @@ namespace string_tools
}

//----------------------------------------------------------------------------
void trim_left(std::string& str)
{
boost::trim_left(str);
return;
}

//----------------------------------------------------------------------------
void trim_right(std::string& str)
{
boost::trim_right(str);
return;
}

std::string pad_string(std::string s, size_t n, char c, bool prepend)
{
if (s.size() < n)
Expand Down

0 comments on commit b07a97c

Please sign in to comment.