Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweak to build on Linux #5

Closed
Chaircrusher opened this issue Jan 11, 2018 · 2 comments
Closed

Minor tweak to build on Linux #5

Chaircrusher opened this issue Jan 11, 2018 · 2 comments

Comments

@Chaircrusher
Copy link

On Centos7 the compilers are older than the standard, and this one minor tweak is the difference between the build succeeding and failing -- the version of std::regex_replace won't take a string constant as the last argument. This should work with every C++ compiler. I've tested it with CLang as well...

diff --git a/src/TSTextField.cpp b/src/TSTextField.cpp
index 88390f6..53c1110 100644
--- a/src/TSTextField.cpp
+++ b/src/TSTextField.cpp
@@ -37,7 +37,7 @@ std::string TSTextField::cleanseString(std::string newText)
{
// Remove invalid chars
std::stringstream cleansedStr;

  •   std::regex_replace(std::ostream_iterator<char>(cleansedStr), newText.begin(), newText.end(), regexInvalidChar, "");
    
  •   std::regex_replace(std::ostream_iterator<char>(cleansedStr), newText.begin(), newText.end(), regexInvalidChar, std::string(""));
      return cleansedStr.str().substr(0, maxLength);
    
    }
    } // end cleanseString()
@chichian
Copy link
Collaborator

Thank you for reporting and fixing :). Will update it in next release. Sorry for the late response. It's been busy IRL.

@chichian
Copy link
Collaborator

Hi Chaircrusher,

Thank you again. Your changes have been incorporated in the 0.5.5.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants