aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkString.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkString.cpp')
-rw-r--r--src/core/SkString.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index fee614cc03..5d1b8ceea3 100644
--- a/src/core/SkString.cpp
+++ b/src/core/SkString.cpp
@@ -36,13 +36,23 @@ static const size_t kBufferSize = 512;
///////////////////////////////////////////////////////////////////////////////
-bool SkStrEndsWith(const char string[], const char suffix[]) {
+bool SkStrEndsWith(const char string[], const char suffixStr[]) {
SkASSERT(string);
- SkASSERT(suffix);
+ SkASSERT(suffixStr);
size_t strLen = strlen(string);
- size_t suffixLen = strlen(suffix);
+ size_t suffixLen = strlen(suffixStr);
return strLen >= suffixLen &&
- !strncmp(string + strLen - suffixLen, suffix, suffixLen);
+ !strncmp(string + strLen - suffixLen, suffixStr, suffixLen);
+}
+
+bool SkStrEndsWith(const char string[], const char suffixChar) {
+ SkASSERT(string);
+ size_t strLen = strlen(string);
+ if (0 == strLen) {
+ return false;
+ } else {
+ return (suffixChar == string[strLen-1]);
+ }
}
int SkStrStartsWithOneOf(const char string[], const char prefixes[]) {
@@ -602,4 +612,3 @@ SkString SkStringPrintf(const char* format, ...) {
#undef VSNPRINTF
#undef SNPRINTF
-