Unverified Commit dc39c37b authored by Wolle's avatar Wolle Committed by GitHub

little fix in endsWith()

has no effect yet
parent 8efe3109
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* *
* Created on: Oct 26.2018 * Created on: Oct 26.2018
* *
* Version 3.0.7p * Version 3.0.7q
* Updated on: Nov 12.2023 * Updated on: Nov 26.2023
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
* *
*/ */
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Created on: Oct 28,2018 * Created on: Oct 28,2018
* *
* Version 3.0.7p * Version 3.0.7q
* Updated on: Nov 12.2023 * Updated on: Nov 26.2023
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
*/ */
...@@ -288,14 +288,14 @@ private: ...@@ -288,14 +288,14 @@ private:
return true; return true;
} }
bool endsWith (const char* base, const char* str) { bool endsWith(const char *base, const char *searchString) {
//fb int32_t slen = strlen(searchString);
int slen = strlen(str) - 1; if(slen == 0) return false;
const char *p = base + strlen(base) - 1; const char *p = base + strlen(base);
while(p > base && isspace(*p)) p--; // rtrim // while(p > base && isspace(*p)) p--; // rtrim
p -= slen; p -= slen;
if (p < base) return false; if(p < base) return false;
return (strncmp(p, str, slen) == 0); return (strncmp(p, searchString, slen) == 0);
} }
int indexOf (const char* base, const char* str, int startIndex = 0) { int indexOf (const char* base, const char* str, int startIndex = 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment